How to Produce PDF Files Fitting the Physical Page on Printing
Environment
Product | Progress® Telerik® Reporting |
Rendering Format |
Description
On printing a PDF file from a PDF Reader, there is an option 'Fit to Page' allowing you to scale the document's content to fit the selected page size. This feature can be used to scale reports on printing them.
Solution
-
Open the report in a Report Designer:
Set the report's PageSettings.PaperKind property to Custom
Set the report's PagseSettings.PaperSize property to a size allowing you to gather the whole content into a single page in Print preview.
-
Configure the PDF rendering extension:
- Set its ViewerPrintScaling parameter to AppDefault. More details about the required settings can be found in Telerik Reporting Configuration Section and Extensions Element.
- Set its Javascript parameter to
"this.print({bUI: true, bSilent: false, bShrinkToFit: true});"
. This will force the PDF reader to raise its Print Dialog on opening the PDF file.
For example:
<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="JavaScript" value="this.print({bUI: true, bSilent: false, bShrinkToFit: true});"/>
<Parameter name="ViewerPrintScaling" value="AppDefault"/>
</Parameters>
</Extension>
</Render>
</Extensions>
</Telerik.Reporting>
....
</configuration>
The scaling mechanism of PDF Readers is out of the scope of the reporting engine.