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

Assignee

Unassigned

Reporter

Zac Spitzer

Priority

Critical

Labels

Fix versions

None

Affects versions

Configure