Tuesday 5 May 2020

GhostScript: PDF to TIFF conversion with page resize

https://comp.lang.postscript.narkive.com/wUGvZLpW/ghostscript-pdf-to-tiff-conversion-with-page-resize

 I'm trying to convert PDF files to multipage TIFF files using
GhostScript 8.00. I need to build a command line which can be called
programatically in a batch job (so I can't use GSView to do the work).

I successfully managed to convert the files but I can't figure out how
to scale the output to fit the -sPAPERSIZE I set (A4). If I use
-dFIXEDMEDIA the page are not scaled but cropped. GSView can scale the
pages, so I know it's possible, but how does it do this?

I tried to add to my command line the following parameters:

-c "<< /Policies << /PageSize 5 >> /PageSize [595 842]
/InputAttributes << 0 /PageSize [595 842] >> >> >> setpagedevice" -f

But the output is not scaled. I currently use the following command
line:

c:\gs\gs8.14\bin\gswin32c.exe -r300 -dNOPAUSE -dNOPAGEPROMPT -dBATCH
-sFONTPATH=C:\WINNT\fonts -sDEVICE=tiffg4 -sPAPERSIZE=a4
-sOutputFile=%1.tif %1

Thank you.

 Ok, I finally managed to solve the problem -dDEVICEWIDTH=2479
-dDEVICEHEIGHT=3508 -dPDFFitPage switchs).

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive