Re: Using Ghostscript to Scale PDF Files



On Dec 9, 2:45 am, Helge Blischke <h.blisc...@xxxxxx> wrote:
ReproRog wrote:
I need to scale PDF files by a certain percentage whilst ripping to a
raster format like tiffg4 or pxl color. If I attempt to convert the
PDF (841mm x 594mm) directly to the raster format it doesn't scale (or
rotate or shift):
************************MyCommand.CMD**********************************
-dBATCH
-dNOPAUSE
-dSAFER
-r600
-sDEVICE=tiffg4
-sOutputFile=MyTif.tif
-c "<</Policies <</PageSize 5>> >> setpagedevice "
-c "<< 0.5 0.5 scale -90 rotate -2384 0 translate >> setuserparams"
-f MyPDF.PDF
**********************End MyCommand.CMD*****************************

If I first convert the PDF to EPS using epswrite then use a simliar
command file to the above to create the resultant tiffg4 file it
works.

*************************MyCommand1.CMD - PDF-

EPS******************************

-dBATCH
-dNOPAUSE
-dSAFER
-r600
-sDEVICE=epswrite
-sOutputFile=MyEps.EPS
-f MyPDF.PDF
************************End MyCommand1.CMD*************************
*************************MyCommand2.CMD - EPS-

TIFG4******************************

-dBATCH
-dNOPAUSE
-dSAFER
-r600
-sDEVICE=tiffg4
-sOutputFile=MyEps.TIF
-c "<</Policies <</PageSize 5>> >> setpagedevice "
-c "<< 0.5 0.5 scale -90 rotate -2384 0 translate >> setuserparams"
-f MyEps.EPS
************************End MyCommand2.CMD*************************

Not too bad performance-wise for the B&W to tiffg4 but when converting
colour PDFs to EPS the file size blows out to 100's MB resulting in a
huge PXL file.

Is there a way to scale the PDFs directly using the -c switch of
GhostScript ? I have tried many permutations (excpt the right one) but
it appears GS doesn't want to/can't scale a PDF using the above
operators. I can't use fit to page methods as sometimes the scale
needs to accurately set.

Any help would be appreciated.

Try
-c "<</BeginPage{0.5 0.5 scale -90 rotate -2384 0 translate}>> setpagedevice"
instead.

Helge

--
Helge Blischke
Softwareentwicklung

H.Blisc...@xxxxxxxx Hide quoted text -

- Show quoted text -

Thanks for the reply. This scales, rotates and shifts the image but
still puts it on the original size page. The A1 (594 x 841mm) PDF has
all the image data scaled put the resultant tiff is still 841 x 594mm.
Is there a way to scale the target page size as well ?

Thanks again...

Roger, over and out.
.



Relevant Pages

  • Re: [a0poster] A4 sized version of A0 poster
    ... I prefer to generate the poster in its original size as a PDF and scale ... My real adress is at es dot aau dot dk for user tha. ...
    (comp.text.tex)
  • Re: [a0poster] A4 sized version of A0 poster
    ... this seems like a feasible option. ... that I have to open the PDF in Acrobat to scale it and then print it to ... a new PDF through a ps2pdf conversion. ... conversion through Acrobat Reader. ...
    (comp.text.tex)
  • Using Ghostscript to Scale PDF Files
    ... raster format like tiffg4 or pxl color. ... PDF directly to the raster format it doesn't scale (or ...
    (comp.lang.postscript)
  • Re: Using Ghostscript to Scale PDF Files
    ... raster format like tiffg4 or pxl color. ... PDF directly to the raster format it doesn't scale (or ...
    (comp.lang.postscript)
  • Re: Gdi+, GraphichsPath.GetBounds() bug?
    ... In my sample I rotate first and then scale the resulting path, ... > SolidBrush b = new SolidBrush; ... >> represent the bounding rectangle of the transformed path: ...
    (microsoft.public.win32.programmer.gdi)