cfpdf action="merge" requires overwrite=true even when it shouldn't

Description

Latest Lucee Snapshot as of 6/19 (5.3.3.56) and latest PDF extension (1.0.0.73-SNAPSHOT)

See this repo for a simple repro case: https://github.com/MordantWastrel/cfpdf_merge

Start the server with box server start and wait for the PDF extension to load. Then hit /test-script.cfm (the other test files just do the same thing with the tag version - these are there only to make sure there was no difference in behavior between cfpdf() and <cfpdf>)

The code is meant to merge the two files in the /pdf directory into /merged.pdf.

If you try to run it, it will complain that the file /merged.pdf already exists, even though it does not. It appears this is because the PDF engine goes to merge the second document into merged.pdf after creating it, finds it exists, and then throws the error, even though the check for existence should only be done the first time it creates the file – obviously it's going to exist for subsequent merges within the same cfpdf call.

If you specify overwrite = true, it works correctly.

Environment

None

Assignee

Michael Offner

Reporter

Samuel W. Knowlton

Priority

Major

Labels

Fix versions

None

Affects versions

Configure