Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 243
Registered: ‎05-01-2016
Accepted Solution

PDF plotting with the SDK

I installed GraphicsMagick and am plotting with the PDF option from the SDK sucessfully but the size of the output files is very large (20meg +) when a raster backdrop is included.  They are just 8.5 by 11" sheets and we would like the plot output to be small enough to be suitable for email.  Is there any way to produce smaller PDF files other than leaving off the aerial imagery we would like to be part of the plot?  Thanks!

Technical Evangelist
Posts: 978
Registered: ‎09-11-2015

Re: PDF plotting with the SDK

[ Edited ]

Hi Jane,

 

The snapshot page creates a PNG file which can really grow up on raster imagery. No matter what you have set in the legend entry as output type, the printing service compiles a single PNG file that is then converted to PDF file. It is likely not desired to use JPEG as vector data and texts would become quite blurry.

 

You can however try to reduce the number of colors in the output PDF file by GraphicsMagick reprocessor. Try to add parameter "-colors 256" to the ConverterArguments section in Print Service web.config which will convert the PNG32 to PNG8, hopefully making the images bit smaller.

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 243
Registered: ‎05-01-2016

Re: PDF plotting with the SDK

[ Edited ]

Thanks - I will try that

Currently it is


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

 

Should i add   -colors 256 right after the {2} (with a space after the {2})?

Regular Contributor
Posts: 243
Registered: ‎05-01-2016

Re: PDF plotting with the SDK

[ Edited ]

If i run from the command line in a dos window:

gm convert -colors 256 input.png output.pdf 

 

it works great - i can even use 16 as the number of colors and get a good (and small!) output image

Am i editting the web.config file incorrectly?

 

 

When i  print from the SDK i get:

 

The pdf file generated is just the error message "{"error":"Unknown error"}"

 

I changed it to <value>-colors 256</value> because i couldn't get it to work and am getting this message

 

 error.png

I'm using:

 


<setting name="ConverterArguments" serializeAs="String">
<value>convert -colors 256</value>
</setting>

Highlighted
Technical Evangelist
Posts: 978
Registered: ‎09-11-2015

Re: PDF plotting with the SDK

[ Edited ]

Hi Jane,

 

I have it like this and the PDF produced is fine:

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

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 243
Registered: ‎05-01-2016

Re: PDF plotting with the SDK

i will copy your exact line and try again

The gm convert works great from command line - can make a nice small pdf!

Regular Contributor
Posts: 243
Registered: ‎05-01-2016

Re: PDF plotting with the SDK

[ Edited ]

The problem was that i initially editted web.config incorrectly and then my modifications were not being processed.  After rebooting, it worked.

Thanks!  gm convert  -colors 256 worked  all along.  Thanks!

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.