Can't reliably use both classic and modern PDF engines in same application

Description

Our application has a bunch of cfdocuments in it, and we've just upgraded from Lucee 4.5 to 5.3. In order to keep our PDFs rendering correctly, we've set (this.pdf.type = "classic"\;) in our root Application.cfc.

Updated description:

We would like to be able to upgrade our PDFs to the modern rendering engine gradually. This doesn’t seem to be possible currently. A simple API would be to allow each cfdocument tag to specify an engine to use for that document. We’ve implemented this feature in

Original description follows:

However, we're working on some new cfdocuments, and we'd like to use the new PDF rendering engine for those. The only way I've found to do this so far is to put them in a subdirectory, with a child Application.cfc, where we specify (this.pdf.type = "modern"\;). That appears to work, for the most part, but sometimes when we try to use the new modern PDFs, we get an error "please restart your Lucee server!"

That error appears to originate here: https://github.com/lucee/extension-pdf/blob/master/source/java/src/org/lucee/extension/pdf/pd4ml/PD4MLPDFDocument.java#L349

I've checked ApplicationSettings.getApplicationSettings(pc).getType() in both the main and subdirectories, and it is, appropriately, different in the two places. It seems like the thing that's going wrong is that the code in PD4MLPDFDocument.java should not be running when we're using the modern PDF engine.

1. Am I right about what's going wrong here?
2. Is our workaround (overriding this.pdf.type in a sub-application) a supported use case?
3. If not, is there another supported way to use the modern PDF engine for some cfdocuments while using the classic engine for others?
4. If not, it seems like we need to add a way to do this, otherwise developers will not be able to migrate to the new engine unless they update all of their cfdocuments at once, which is risky.

Environment

Lucee 5.3.3.62
CentOS 7.7.1908

Attachments

4

Activity

Zac Spitzer 28 October 2020 at 16:09

I just added a note about type="modern|classic" to the Flying Saucer page on docs

Ben Nadel 9 September 2020 at 10:18

I just tried the latest snapshot, and it seems to work for me as well. Groovy!

Pothys - MitrahSoft 7 September 2020 at 15:55

I've checked this issue and its works fine with extension - pdf fixed version.

Michael Offner 7 September 2020 at 13:24

i added the PR and created a new version and attached it to the latest Lucee version, please give this an other try (the NPE).

Michael Offner 7 September 2020 at 12:56

pulled

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

Sprint

Affects versions

Created 2 October 2019 at 15:46
Updated 28 October 2020 at 16:09
Resolved 7 September 2020 at 15:55