PDF2ImageICEpdf results in low quality image, use PDFBox to directly extract images instead

Description

Via Slack

When working with cfdocument action="addwatermark" copyfrom="foo.pdf"> we notice that the quality of the watermark is significantly worse than the original (foo.pdf). Images and text are blurry. This happens with Lucee 5.3.4.80 and the Flying saucer engine.

We migrated this functionality from an ACF11 server, where we did not have this problem.

https://github.com/lucee/extension-pdf/blob/master/source/java/src/org/lucee/extension/pdf/tag/PDF.java#L967

https://github.com/lucee/extension-pdf/blob/master/source/java/src/org/lucee/extension/pdf/img/PDF2ImageICEpdf.java#L75

This uses ICE PDF to copy from the PDF like a screenshot which results in a low quality image

PDFBox allows directly extracting the image from the PDF

This would allow removing icepdf altogether from the extension, reducing the size of Lucee by 409 Kb

Environment

None

Activity

Show:

Zac Spitzer 14 September 2023 at 09:36

Zac Spitzer 14 September 2023 at 09:31

PDFbox is now used, I believe we can just remove this all together?

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 8 September 2020 at 10:16
Updated 25 September 2023 at 14:23
Resolved 15 September 2023 at 14:38

Flag notifications