[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?

No, indeed.  Mac OS X's `preview' does it out of the box.
Really? Cool. Of course, I have to admit OS X is pretty impressive, even if it isn't my cup of tea.

Still, I will say that Apple and Adobe get along pretty well, and I wouldn't be surprised if they licensed some code from Adobe for the purpose -- not something that can be expected in the FLOSS world.
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.

Actually, PDF is not a programming language, contrary to Postscript.
So it's much easier to deal with (and more difficult to introduce viruses
into it, among other things).
Really? Can you explain more about this? I thought PDF was a subset of Postscript with some kind of compression and/or encryption applied. Was I mislead? If so, what is it really? Is there no relationship between the two?
What exactly are you trying to extract?

For example, I have a PDF which contains a poster with (on the side) some
meta-information about the author, the intended color scheme, the intended
paper quality, the revision number, the order number, the purpose, the date,
and I'd like to take the poster part and throw away the rest.

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.

I do want a picture out, but not a bitmap picture.
Right, I can't help there, but see the other replies you've gotten -- I'm really glad you asked this question, because I had given up on finding anything beyond the tools I mentioned, and now there are at least three new tools to look at!


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.

I thought about it too, but couldn't find a postscript tool that does it.

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

Hmm... never heard of it.  Looks interesting.  I don't know how to make it
read PDF, tho.

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.

Yes, I looked at it, but I want to extract part of a page.


Reply to: