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