This code produces a PDF with an image that pulls from a local file path and works on Lucee 5.2
However, the same code produces a PDF with no image on Lucee 5.3+
I've narrowed down to the fact that Lucee 5.3's PDF engine requires the file paths to
Be URL encoded (sort of as URLEncodedFormat() and encodeForURL() both cause issues)
use only forward slashes, even on Windows.
If I run all my local file paths through this code, it seems to work:
That would turn the path above (that worked in Lucee 5.2) into this:
Looking at your commit, I have some concerns about your implementation. Instead of using my fix I provided in the ticket and confirmed, it appears you're reading the image to base64 and including it inline in the PDF. I stronglyk recommend against this. I tested this and while it works well for small PDFs containing few images, it performs very poorly for large PDFs containing a lot of images.
Can you please confirm that the PDF extension will not be trying to convert all images to base64 and in-lining them. That is not a good solution. The best solution is the one I showed in the ticket description.
fair concern. I will use a Uri path in case of a already local file. that is a simple change. but i will still download external files, the http FS already can use the global proxy.
BTW better use HTTPUtil.toURL(…) instead of new URL() it will give you better results.
OK changed the implementation as suggested
Thanks Micha!