[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to cut/crop a part of a PDF file

Stefan Monnier wrote:
What tool can I use to extract some part of a pdf file?
In kpdf, I can copy a piece of the PDF image and save it, but it's only
saved as a bitmap, whereas I'd like to keep it in vector form.

You don't ask much, do you?

AFAIK: PDF is not strictly speaking a vector-graphics format. It is a subset of Postscript, which is actually a programming language for drawing documents. It is designed for output, not input or editing. Therefor, it is *very* hard to convert from PDF to a structured document format.

What exactly are you trying to extract?

I assume you aren't trying to get pictures out, but for the benefit of anyone else, I'll mention pdfimages from the package xpdf-utils, which will extract the bitmapped images from a PDF.

That package also contains pdftotext which will extract the text stream, but with no formatting. For simple documents this can be useful -- other times, it might be very garbled, as the order the text is in in the file is not guaranteed to match the order on screen / paper.

Also from xpdf-utils you can find pdftops -- converting PDF to Postscript is kind of silly, but just maaaaybe you can do what you want with a Postscript.

Scribus is probably your best bet for actually importing a PDF in any friendly way -- I think they were at least working on that, not sure if it is really usable

Finally, pdftk is described as "an electronic stapler-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses" for PDFs. Most notably for your question, it will let you split the pages in to separate files.

If anyone knows any better tools then these, I want to know!


Reply to: