Page Scaling in Printed PDFs

6 posts, 1 answers
  1. Stephen McDaniel
    Stephen McDaniel avatar
    48 posts
    Member since:
    Mar 2008

    Posted 13 Mar 2009 Link to this post

    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
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Mar 2009 Link to this post

    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.
  3. Stephen McDaniel
    Stephen McDaniel avatar
    48 posts
    Member since:
    Mar 2008

    Posted 17 Mar 2009 Link to this post

    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



  4. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 18 Mar 2009 Link to this post

    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.
  5. Rajiv
    Rajiv avatar
    4 posts
    Member since:
    Jul 2014

    Posted 29 Jul 2014 in reply to Steve Link to this post

    Can you attach a sample windows form project with the page scaling config for windows forms project?
  6. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 01 Aug 2014 Link to this post

    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.

     
Back to Top