Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi,

I'm looking for a way to resample the images in a pdf file to reduce file size, ideally on the command line. The big issue seems to be finding a solution that doesn't destroy the layers within the PDF (or OCGs if you want to be pedantic!)

I've tried converting the PDF file to PostsScript using pdf2ps and then using GhostScript like this...

gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=myoutputfile.pdf -dPDFSETTINGS=/ebook myinputfile.ps

...to turn that Postscript back to a PDF which works nicely but I lose my Layers/OCGs.

Does anyone know a way of doing this either on the command line or (gulp) via Objective-C?

Thanks in advance,

Rob
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.