[ 
https://issues.apache.org/jira/browse/PDFBOX-5622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17756693#comment-17756693
 ] 

liu commented on PDFBOX-5622:
-----------------------------

thanks for reminding,ok!

> Convert the same page,Why are temp files getting bigger and bigger
> ------------------------------------------------------------------
>
>                 Key: PDFBOX-5622
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5622
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.28
>            Reporter: liu
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>         Attachments: screenshot-1.png, screenshot-2.png, 复杂cad-转图片耗时.pdf
>
>
> demo:
> {code:java}
> public static void main2(String[] args) throws IOException, 
> InterruptedException {
>               File file = new File("D:\\file/复杂cad-转图片耗时.pdf");
>               final PDDocument load = PDDocument.load(file, 
> MemoryUsageSetting.setupMixed(1048576)
>                               .setTempDir(new File("D:\\test")));
>               for (int i = 0; i < 1000; i++) {
>                       PDFRenderer renderer = new PDFRenderer(load);
>                       int pageIndex = 6;
>                       float scale = 2f;
>                       try {
>                               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 (Exception e) {
>                               System.out.println(e);
>                       }
>               }
>       }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to