Showing results for 
Search instead for 
Do you mean 

Output PDF to standard page size

by Technical Evangelist on ‎01-19-2017 07:05 AM - edited on ‎04-21-2017 03:54 AM by Technical Evangelist (5,083 Views)


Using the Geospatial Portal Print service along with GraphicsMagick to convert to PDF results in an output page size that is not equal to that of the standard of the page size ie. A4 selected in the Print UI


Using the standard page size example of A4 at a DPI of 300 (default is 96) as specified in the PrintService web.config will result in an output PDF page size of 8.26 x 11.68 cm. The standard for A4 is 21.0 x 29.7 cm, a factor of 2.54 greater than the output from Print Service.

The Print output png (prior to PDF conversion) uses the PrintOutputDPI from the web.config of the print service while the page size is set in centimeters. This is the reason for the scaling factor 1 inch = 2.54 cm and leads to the PDF page size discrepancy from the standard.


The convert settings for GraphicsMagick PDF creation are controlled in the <setting> section of the Print Service web.config found at (default location) C:\Program Files\Common Files\Hexagon\Services\Supporting Services\PrintingService and can be manipulated to ensure the standard page size is honored on the output PDF.

Replacing the default converter arguments with the following ensures the 'PixelsPerInch' are used in the output PDF resulting in page size to match the standard as specified in the Printing UI.


<setting name="ConverterArguments" serializeAs="String">

        <value>convert "{1}" -density {0} -units PixelsPerInch EPDF:"{2}"</value>