How to crop AI (PDF embedded) to PNG using Ghostscript?

264 Views Asked by At

I've read a number of post and tried to follow but it's not working.

Using GS (gsdll32.dll) with the following arguments:

Info from bbox

%%BoundingBox: 33 244 577 546 %%HiResBoundingBox: 33.611976 244.201633 576.009896 545.351819

render and crop AI2PNG -P- -dNOPAUSE -dBATCH -dSAFER -q -IC:/Program Files (x86)/Gerber Scientific Products/OMEGA 6.50/Software/gs/fonts;C:/Program Files (x86)/Gerber Scientific Products/OMEGA 6.50/Software/gs/lib;C:/Program Files (x86)/Gerber Scientific Products/OMEGA 6.50/Software/gs/resource -sDEVICE=pngalpha -g544x302 -c <> setpagedevice -sOutputFile=E:/Images/AI from PLM/captain-america [Converted].png E:/Images/AI from PLM/captain-america [Converted].ai

Without any cropping logic I get the image on an 8.5 x 11, with cropping(above commands) the objects are translated mostly off the top of the page and do not seem to move to the left.

The size of the result image is correct.

Does anyone see anything wrong?

Thanks

1

There are 1 best solutions below

3
On

You've put the /Install after the input file, that means it will be executed after the input file is complete. Which means it takes effect after the input is completely processed, which is too late to have nay effect.

Order of switches, and particularly order of input, is important in Ghostscript.

That's assuming that 'AI2PNG' is a synonym for Ghostscript.