Mailing List Archive


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

Re: [tlug] Trying to extract images from a PDF



On Sat, 14 Jul 2007 23:27:50 +0900, "Dave Gutteridge" <ebisudave@example.com>
wrote:

> I've tried tkpdf, and pdftohtml, but while I've been able to break a PDF
> file into small PDF files containing single pages, I haven't been able to
> turn them into images like JPG or PNG.

GhostScript does this perfectly well.

There are 2 ways to do this:

1) You can use external tools to process the original PDF and leave you with
a single-page PDF containing only the page of which you want an image and
then:

$ gs -dBATCH -dNOPAUSE -r300 -sDEVICE=pngalpha -sOutputFile=whatever.png SinglePagePDFFile.pdf

2) You can have GhostScript process the entire original PDF file and
generate an individual .png file for each page:

$ gs -dBATCH -dNOPAUSE -r300 -sDEVICE=pngalpha -sOutputFile=whatever%d.png OriginalPDFFile.pdf

Take a look at the man page for 'gs' for the meaning of the various parts
of these incantations.

-- 
G. Stewart - gstewart@example.com

The new Linux anthem will be "He's an idiot, but he's ok", as performed
by Monthy Python.  You'd better start practicing.
        -- Linus Torvalds, announcing another kernel patch

Attachment: pgpw0jmm9IRQB.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links