This is a migrated thread and some comments may be shown as answers.

Page Scaling in Printed PDFs

5 Answers 384 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen McDaniel
Top achievements
Rank 1
Stephen McDaniel asked on 14 Mar 2009, 02:21 AM
I know I can control the page scaling of Exported PDFs using the "ViewerPrintScaling" rendering extension.  However, it appears this setting is ignored when using the Print button on the toolbar.  Instead, PDFs are always scaled.  It would be nice if PDFs always respected the rendering extension configuration (even when printing).  Or is there some other way that I can force printed PDFs to not scale?

Thanks,
-Stephen

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 Mar 2009, 09:48 AM
Hello Stephen,

I've tested this locally and the behavior of the directly printed file through the print button of the web viewer and from the exported pdf file is the same. In fact there is no surprise here, as when printing, the file is internally exported to pdf.
As far as I understand your goal is to have Page Scaling set to None - can you verify that you have set this properly in the web.config file:

<configSections> 
    <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.0.9.311, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" /> 
  </configSections> 
  <Telerik.Reporting> 
    <Extensions> 
      <Render> 
        <Extension name="PDF" visible="true"
          <Parameters> 
            <Parameter name="ViewerPrintScaling" value="None" /> 
          </Parameters> 
        </Extension> 
      </Render> 
    </Extensions> 
  </Telerik.Reporting> 

I've attached a sample project that shows the correct behavior on our end. Please give it a spin and let us know what differs in your case.

All the best,
Steve
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stephen McDaniel
Top achievements
Rank 1
answered on 17 Mar 2009, 06:06 PM
I tried the Solution you attached and the print dialog still came up with Page Scaling of "Fit to Printer Margins".  I'm using Acrobat Version 7.0 - maybe different versions behave differently.

Looking through the source code, it appears the print dialog is shown by some JavaScript that you inject into the PDF Document in the PrepareForSave() method of the Telerik.Reporting.Pdf.PdfDocument class.  The JavaScript is:

this.print({bUI: true,bSilent: false,bShrinkToFit: true});this.closeDoc(); 

In that JavaScript, it's hardcoded to shrink the document when printing.  Using similar JavaScript, I may have come up with a possible workaround that works for me.  In my web.config, I add custom JavaScript to all PDFs using the same JavaScript above except I set bShrinkToFit to false.  Then when I print with the button, the Page Scaling does get defaulted to None.  This also affects exported PDFs but I do my exporting through a custom HttpHandler so I can clear out the custom JavaScript in that.

My only concern is that all this behavior could be different between versions of Acrobat since the solution that seemed to work for you, doesn't work for me.

Any thoughts?

Thanks,
-Stephen



0
Accepted
Steve
Telerik team
answered on 18 Mar 2009, 08:21 AM
Hello Stephen,

Indeed the Acrobat behavior seems to be different as the project sent works fine on Acrobat 9.0. However now that you've mentioned the hardcoded attribute, we would further investigate the reason behind doing this in the first place and change it if necessary for the subsequent version of the product.

Thank you for bringing this to our attention.

Greetings,
Steve
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rajiv
Top achievements
Rank 1
answered on 30 Jul 2014, 01:07 AM
Can you attach a sample windows form project with the page scaling config for windows forms project?
0
Stef
Telerik team
answered on 01 Aug 2014, 02:46 PM
Hello,

Please refer to my post in the following forum thread: Dynamic Report column size. The PDF settings must be applied in the start application's configuration file (app.config):
<configuration>
    <configSections>
        <section
                name="Telerik.Reporting"
                type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting, Version=x.x.x.x, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
                allowLocation="true"
                allowDefinition="Everywhere"/>
    </configSections>
  <Telerik.Reporting>
        <Extensions>
            <Render>
                <Extension name="PDF" description="PDF Description">
                    <Parameters>
                        <Parameter name="ViewerPrintScaling" value="None"/>
                    </Parameters>
                </Extension>
            </Render>
        </Extensions>
    </Telerik.Reporting>
Where x.x.x.x must be substituted with the used Telerik Reporting version.

Please let us continue the discussion in one of the threads you posted in, or in a support ticket where we can exchanged files freely.

Thank you for your understanding.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Stephen McDaniel
Top achievements
Rank 1
Answers by
Steve
Telerik team
Stephen McDaniel
Top achievements
Rank 1
Rajiv
Top achievements
Rank 1
Stef
Telerik team
Share this question
or