[
https://issues.apache.org/jira/browse/PDFBOX-5751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17807021#comment-17807021
]
liu edited comment on PDFBOX-5751 at 1/16/24 3:54 AM:
------------------------------------------------------
Hello, what version of jdk are you using? What I reproduce locally is the error
reported in JPEGImageReader of jdk8.
was (Author: JIRAUSER297279):
Hello, what version of jdk are you using? What I reproduce locally is the error
reported in JPEGImageReader of jdk.
> Convert to image exception
> --------------------------
>
> Key: PDFBOX-5751
> URL: https://issues.apache.org/jira/browse/PDFBOX-5751
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.30, 3.0.1 PDFBox
> Reporter: liu
> Priority: Major
> Attachments: 666.pdf
>
>
> {code:java}
> public static void main(String[] args) throws IOException,
> InterruptedException {
> File file = new File("D:\\qys\\666.pdf");
> final PDDocument load = PDDocument.load(file,
> MemoryUsageSetting.setupTempFileOnly()
> .setTempDir(new File("D:\\fcs\\test")));
> try {
> PDFRenderer renderer = new PDFRenderer(load);
> int pageIndex = 0;
> float scale = 2f;
> BufferedImage bufferedImage =
> renderer.renderImage(pageIndex, scale, ImageType.RGB);
> FileOutputStream fos = null;
> try {
> fos = new FileOutputStream(new
> File("D:\\fcs\\test/test6/image" + pageIndex + ".jpg"));
> ImageIO.write(bufferedImage, "jpg", fos);
> } finally {
> if (fos != null) {
> fos.close();
> }
> }
> } catch (Throwable e){
> e.printStackTrace();
> }
> Thread.sleep(6000000);
> }
> {code}
> java version:jdk8
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]