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.
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.
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).
I've checked this issue and its works fine with extension - pdf fixed version.
I just tried the latest snapshot, and it seems to work for me as well. Groovy!
I just added a note about type="modern|classic" to the Flying Saucer page on docs