Reputation: 1935
I work a lot with latex and for my images i use the eps and pdf formats. When I create a figure I often need to trim it, because I want to get rid of white margins all around the pic. At the moment I'm using GIMP, import the figure and autotrim the edges. However if the eps/pdf file before the import is 60KB, after the export with GIMP it can be 200-300KB (depending on the dpi resolution that I choose).
Is there a way to trim eps/pdf files without losing its lightweight and sharpness (because after the import it goes from vector to raster, I suppose)?
I'm working on Mac/Linux
Thanks for your help
Upvotes: 3
Views: 2816
Reputation: 327
For OSX, you can just use Preview. It can crop PDF files, by changing the Pagesize of the CropBox. This is a non-destructive change, as the original PDF is contained in the MediaBox. Anything outside of the CropBox is hidden by default.
It's essentially just editing metadata of the PDF instead of the image. No re-rendering done.
Upvotes: 0
Reputation: 1534
For visual trimming (GUI) I would suggest PDFQuench (at least for PDF). If you prefer the command-line PDFcrop might be your choice.
Both tools are for Linux - the Mac has its native Preview-tool, which can also crop.
Hope that helped a bit.
EDIT:
For automatic removal of margins there is Perl script called pdfcrop.pl which uses ghostscript and pdftex in the background - I haven't tested it, but it looks promising.
Upvotes: 3