On Sat, Jul 12, 2008 at 05:17:46PM +0200, David Triebe <[EMAIL PROTECTED]> 
wrote:
> >is it possible to convert a pdf to jpg with swftools? I mean it's possible
> >in the different way, to convert jpg to swf. I guess i will need another
> >tool fort hat, o rare there any options to build  jpg from pdf or swf?
> 
> I guess swftools is absolutly the wrong tool for you  as your question 
> doesn't have anything to do with swf ;-)

Actually, swftools *can* convert a pdf to an image. :)

Option #1: 
    pdf2swf -p1 file.pdf -o file.swf
    swfrender file.swf -o file.png

Option #2: Use the python gfx module with the following script:
    import gfx
    doc = gfx.open("pdf", "file.pdf")
    page = doc.getPage(1)
    img = gfx.ImageList()
    img.startpage(page.width,page.height)
    page.render(img)
    img.endpage()
    page.save("file.png")

Of course, ImageMagick or pdftoppm is easier and more straightforward.
(Even though Option #2 has the advantage that you can also extract
 the text out of a PDF in the same go, or even run OCR over it)

Greetings

Matthias




Reply via email to