We create PDFs by filling in template PDF form fields, then merging them together. After that, we flatten the merged file and view it with CFContent, which also then deletes it.
When we were in CF9, we had this issue where the files were becoming locked, so deleting the viewed file was silently failing, leaving files on the server. Searches seemed to suggest the following fix, which we think worked. Hard to tell with PDFs.
output_space is a variable name and I believe it puts the pdf in memory.
view_file is a path on the server, using expandPath.
<cfpdf action="merge" directory="#output_path#" name="#output_space#" order="time" ascending="yes" overwrite="yes" />
<cfpdf action="write" source="#output_space#" destination="#view_file#" overwrite="yes" flatten="yes" saveOption = "linear" />
On CF11 this fails with the error, "
An error occurred while reading source for the cfpdf tag.
Error: Variables written as a file by specifying destination in a tag cannot be used again."
I don't quite understand the error. However if in the "merge", I change the "name" to "destination", then it views fine. I'd prefer to have it put the pdf in memory and view it from memory, skipping the "write".
Any idea how to do this?
I tried
<CFCONTENT type="application/pdf" variable="tobinary(tobase64(output_space))">
and many other variations of this.
Also, does anyone know if the defect where using "destination" leaves locked files on the server was fixed on anything past cf8? If so, any idea of the version?
thank you.
daniel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360444