You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Lucas Satabin (JIRA)" <ji...@apache.org> on 2012/05/31 08:24:22 UTC
[jira] [Created] (PDFBOX-1325) Converting page to png creates an
empty image
Lucas Satabin created PDFBOX-1325:
-------------------------------------
Summary: Converting page to png creates an empty image
Key: PDFBOX-1325
URL: https://issues.apache.org/jira/browse/PDFBOX-1325
Project: PDFBox
Issue Type: Bug
Affects Versions: 1.6.0
Reporter: Lucas Satabin
Generating an image from PDF generated by pdfTeX-1.40.12 creates empty images (transparent images in png format, and black images in jpeg format), see pdf-nok.pdf and pdf-nok1.png files attached.
However, pdfTeX versions 1.40.10 and 1.40.13 generate pdf files that are correctly converted to images, see pdf-ok.pdf and pdf-ok1.png files attached.
The code used to generate the png files is the following:
{code:title=Test.java|borderStyle=solid}
import java.awt.image.BufferedImage;
import java.io.File;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.PDFImageWriter;
public class Test {
public static void main(String[] args) throws Exception {
PDDocument docOk = PDDocument.load(new File("pdf-ok.pdf"));
PDDocument docNok = PDDocument.load(new File("pdf-nok.pdf"));
PDFImageWriter imagewriter = new PDFImageWriter();
try {
imagewriter.writeImage(docOk, "png", null, 1, 1, "pdf-ok",
BufferedImage.TYPE_INT_RGB, 100);
imagewriter.writeImage(docNok, "png", null, 1, 1, "pdf-nok",
BufferedImage.TYPE_INT_RGB, 100);
} finally {
docOk.close();
docNok.close();
}
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PDFBOX-1325) Converting page to png creates an
empty image
Posted by "Lucas Satabin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lucas Satabin updated PDFBOX-1325:
----------------------------------
Attachment: pdf-ok1.png
pdf-ok.pdf
pdf-nok1.png
pdf-nok.pdf
> Converting page to png creates an empty image
> ---------------------------------------------
>
> Key: PDFBOX-1325
> URL: https://issues.apache.org/jira/browse/PDFBOX-1325
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.6.0
> Reporter: Lucas Satabin
> Attachments: pdf-nok.pdf, pdf-nok1.png, pdf-ok.pdf, pdf-ok1.png
>
>
> Generating an image from PDF generated by pdfTeX-1.40.12 creates empty images (transparent images in png format, and black images in jpeg format), see pdf-nok.pdf and pdf-nok1.png files attached.
> However, pdfTeX versions 1.40.10 and 1.40.13 generate pdf files that are correctly converted to images, see pdf-ok.pdf and pdf-ok1.png files attached.
> The code used to generate the png files is the following:
> {code:title=Test.java|borderStyle=solid}
> import java.awt.image.BufferedImage;
> import java.io.File;
> import org.apache.pdfbox.pdmodel.PDDocument;
> import org.apache.pdfbox.util.PDFImageWriter;
> public class Test {
> public static void main(String[] args) throws Exception {
> PDDocument docOk = PDDocument.load(new File("pdf-ok.pdf"));
> PDDocument docNok = PDDocument.load(new File("pdf-nok.pdf"));
> PDFImageWriter imagewriter = new PDFImageWriter();
> try {
> imagewriter.writeImage(docOk, "png", null, 1, 1, "pdf-ok",
> BufferedImage.TYPE_INT_RGB, 100);
> imagewriter.writeImage(docNok, "png", null, 1, 1, "pdf-nok",
> BufferedImage.TYPE_INT_RGB, 100);
> } finally {
> docOk.close();
> docNok.close();
> }
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira