You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Emiel Molenaar <em...@gmail.com> on 2013/12/16 14:38:42 UTC

Fwd: issue converting pdf to png

Hello,

I'm trying to convert the attached PDF to a PNG image. The resulting PNG
contains a plain blue square instead of the illustration of the rabbit as
shown in the PDF.

I run the following code:

            PDDocument pdfDocument = null;
            pdfDocument = PDDocument.load("source.pdf");

            PDFImageWriter pdfWriter = new PDFImageWriter();
            boolean success = pdfWriter.writeImage(pdfDocument, "png", "",
1, 1,
                    "result", BufferedImage.TYPE_INT_ARGB, Toolkit
                    .getDefaultToolkit().getScreenResolution());
            System.out.println(success);

Which produces the following output:

Dec 16, 2013 2:22:14 PM org.apache.pdfbox.util.PDFStreamEngine
processOperator
INFO: unsupported/disabled operation: BDC
Dec 16, 2013 2:22:14 PM org.apache.pdfbox.util.PDFStreamEngine
processOperator
INFO: unsupported/disabled operation: EMC
Dec 16, 2013 2:22:14 PM org.apache.pdfbox.util.PDFImageWriter writeImage
INFO: Writing: kleurtjes-test1.png
true

What can I do to get the correct illustration in the resulting PNG? The
issue occurs in both 1.8.3 (which also suffered a font-issue) and a fresh
clone of the 2.0 git repo.

Thank you!

Kind regards,

Emiel Molenaar

Re: Fwd: issue converting pdf to png

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 16.12.2013 14:38, schrieb Emiel Molenaar:
> Hello,
>
> I'm trying to convert the attached PDF to a PNG image. The resulting PNG
> contains a plain blue square instead of the illustration of the rabbit as shown
> in the PDF.
>
> I run the following code:
>
>              PDDocument pdfDocument = null;
>              pdfDocument = PDDocument.load("source.pdf");
>
>              PDFImageWriter pdfWriter = new PDFImageWriter();
>              boolean success = pdfWriter.writeImage(pdfDocument, "png", "", 1, 1,
>                      "result", BufferedImage.TYPE_INT_ARGB, Toolkit
>                      .getDefaultToolkit().getScreenResolution());
>              System.out.println(success);
>
> Which produces the following output:
>
> Dec 16, 2013 2:22:14 PM org.apache.pdfbox.util.PDFStreamEngine processOperator
> INFO: unsupported/disabled operation: BDC
> Dec 16, 2013 2:22:14 PM org.apache.pdfbox.util.PDFStreamEngine processOperator
> INFO: unsupported/disabled operation: EMC
> Dec 16, 2013 2:22:14 PM org.apache.pdfbox.util.PDFImageWriter writeImage
> INFO: Writing: kleurtjes-test1.png
> true
>
> What can I do to get the correct illustration in the resulting PNG? The issue
> occurs in both 1.8.3 (which also suffered a font-issue) and a fresh clone of the
> 2.0 git repo.
It's hard to say without any more information. Can you proviode us with the pdf
in question, e.g. by a download link (You can't post it here due to some
restrictions to the mailing list)?

> Thank you!
>
> Kind regards,
>
> Emiel Molenaar


BR
Andreas Lehmkühler