Hexagon Geospatial
MENU

WebGIS

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 134
Registered: ‎04-12-2016
Accepted Solution

Geospatial Portal external print service - strange PDFsize

Hi

 

I am on Webmap16.00. I set up a portal external print service (utilizes PhantomJS and GraphicsMagik). Added the service into Geospatial Portal instance, chose PDF print, PDF came out fine except the PDF document size is not right. I used A4, default template.

The real A4 dimension is 11.69x8.27inch (by definition), however the document size is only 4.6x3.3inch. 

WrongSize.PNG

 

 

My question is when a A4 PDF is generated by the print service, shouldn't the document size qualify A4 page definition?

 

My understanding is external print service first generates a raster image (e.g., PNG) and then feeds it into GraphicsMagik to convert it to PDF GraphicsMagic. I am suspecting GraficsMagic is not doing the converting as expected.

So I printed a PNG and then manually converted to PDF using gm convert cmd in GraphicsMagic (without having any other parameters in the cmd). The PDF document size came to be correct! 11.69x8.27inch.

CorrectSize.PNG

 

 

My guess is some 'funny' parameters (e.g., density) had been added to the cmd line, changed the size of PDF.

 

 

 

Any ideas/suggestions/comments are much appreciated.

 

I have attached both PDFs.

 

 

Cheers

Yuan

 

 

Highlighted
Contributor
Posts: 72
Registered: ‎11-02-2015

Re: Geospatial Portal external print service - strange PDFsize

Hi Yuan,

I have been facing the same issue for the German page sizes A4 and A3.

During the print job a temporary png will be created with the specified PrintOuputDPI (tag=”PrintOutputDPI”) as well as the defined page sizes. Both are specified in the web.config of the printing service (C:\Program Files\Common Files\Hexagon\Services\Supporting Services\PrintingService\Web.config).

 

<applicationSettings>
    <Intergraph.MapPrinting.PrintService.Properties.Settings>
      <setting name="PrintOutputDPI" serializeAs="String">
        <value>300</value>
      </setting>
      <setting name="SaveInputImage" serializeAs="String">
        <value>False</value>
      </setting>
      <setting name="PageFormats" serializeAs="Xml">
        <value>
          <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <string>A4,210,297</string>	
	    <string>A3,297,420</string>			
          </ArrayOfString>
        </value>
      </setting>

The problem is that the DPI value is given in pixels per inch whereas the output size is specified in cm.

It took me many tries to found out the correct call for the GraphicsMagick converter. Please be aware that the order of the arguments is important!

 

The convert settings in the web.config of the printing service need to be specified as follows:

 

<setting name="ConverterArguments" serializeAs="String">
        <value>convert "{1}" -density {0} -units PixelsPerInch EPDF:"{2}"</value>
</setting>

 

Let me know if this solves your issue.

Fritz

Geography is what geographers do...
Frequent Contributor
Posts: 134
Registered: ‎04-12-2016

Re: Geospatial Portal external print service - strange PDFsize

Hi Fritz what you have provided works fine for me and also one of our clients. Hero of the day! Smiley Very Happy

 

cheers

Yuan

Contributor
Posts: 72
Registered: ‎11-02-2015

Re: Geospatial Portal external print service - strange PDFsize

Yuan,

 

many thanks for your positive feedback. I am glad that it solves your problem. I spent half a day asking Google and trying those things on the printing service. The reason for the problem (dpi and not dot per cm) was clear to me. But how I do have to add the parameters to the converter line was the tricky thing. Especially since the order of the parameters is important.

So perhaps somebody of the Hexagon guys should add this finding to the documentation. By the way I have submitted my findings already to the Hexagon support.

 

Cheers

Fritz

Geography is what geographers do...
Technical Evangelist
Posts: 1,061
Registered: ‎09-11-2015

Re: Geospatial Portal external print service - strange PDFsize

[ Edited ]

Hi guys,

 

Fritz - thank you very much for reminding me this issue. There's also an article in QA's section:

http://community.hexagongeospatial.com/t5/WebGIS-Q-A/Output-PDF-to-standard-page-size/ta-p/10638

 

However I will also ask for updating the documentation appropriately.

 

Best Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.