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

liu commented on PDFBOX-5581:
-----------------------------

demo:


                final PDDocument load = PDDocument.load(file, 
MemoryUsageSetting.setupTempFileOnly(-1)
                                .setTempDir(new File("D:\\fcs\\test")));

                int numberOfPages = load.getNumberOfPages();
                for (int i = 0; i < numberOfPages; i++) {
                        final int finalI = i;
                        PDFRenderer renderer = new PDFRenderer(load);

                        renderer.setSubsamplingAllowed(true);

                        int pageIndex = finalI;

                        float scale = 2.0f;
                        try {

                                BufferedImage bufferedImage = 
renderer.renderImage(pageIndex, scale, ImageType.RGB);
                                File file1 = new 
File("D:\\fcs\\test/test/imagepdfbox" + pageIndex + ".jpg");
                                ImageIO.write(bufferedImage, "jpg",file1);
                        } catch (Exception e) {
                                System.out.println(e);
                        }
                }

> renderer.setSubsamplingAllowed(true) causing the picture to blur
> ----------------------------------------------------------------
>
>                 Key: PDFBOX-5581
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5581
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.27
>            Reporter: liu
>            Priority: Major
>         Attachments: screenshot-1.png, screenshot-2.png, test.pdf
>
>
>  !screenshot-1.png! 
> renderer.setSubsamplingAllowed(true) causing the picture to blur.
> This causes the following words to be obscured.
> hi!Is there a way to customize the getSubsampling method?like this.
> I want to display the original image within the specified width and height
>  !screenshot-2.png! 



--
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