You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2019/07/03 16:11:00 UTC

[jira] [Closed] (PDFBOX-4591) Black dots and rectangles when converting from pdf to png

     [ https://issues.apache.org/jira/browse/PDFBOX-4591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr closed PDFBOX-4591.
-----------------------------------
    Resolution: Duplicate

Closing as duplicate of PDFBOX-1752, this is the JPEG2000 ink blot bug in the java jpeg2000 image plugin, see the two last comments in the issue on how to fix this.

> Black dots and rectangles when converting from pdf to png
> ---------------------------------------------------------
>
>                 Key: PDFBOX-4591
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4591
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.16
>            Reporter: Michał Pomarański
>            Priority: Major
>         Attachments: test-pdf.pdf
>
>
> I get a weird black dots and rectangles/elipses when I'm trying to convert a pdf file to png image with pdfbox. I haven't noticed anything specific about those pdf files except that they're scanned files. I've also tried using the linux tool `convert` and with that tool I don't have any problems. Here's a sample of the code I'm using:
> {code:java}
> private static BufferedImage rasterizePdfBox(String ref, int pageIndex, PDFRenderer renderer, PreviewMode mode) throws IOException {
>     Future<BufferedImage> result = executorService.submit(() -> {
>         LOGGER.info(String.format("Generate preview for ref: %s, page: %s, mode: %s ", ref, pageIndex, mode.name()));
>         return renderer.renderImageWithDPI(pageIndex - 1, mode.getDpi(), ImageType.RGB);
>     });
>     try {
>         return result.get();
>     } catch (InterruptedException | ExecutionException e) {
>         LOGGER.error(String.format("Error when generating preview: %s", e.getMessage()));
>         Thread.currentThread().interrupt();
>         throw new IOException(e.getMessage());
>     }
> {code}
>  
> I'm attaching an example file that I have this problem with. Thanks!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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