tracker issue : CF-4051144

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: cfpdf read|merge=>write throws PDFInvalidDocumentVariableException unless "read"+LiveCycle

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 09/08/2015

Components: Document Management

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final / 12.0

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on May 17, 2018 using build 2016.0.01.298513
cfpdf action="read" or "action="merge" followed by action="write" throws PDFInvalidDocumentVariableException unless a single PDF was read and it contained a LiveCycle form

(the following makes me wonder what's going on under the PDF hood)

Repro:

1) Download attached PDFWithAcrobatForm.pdf & PDFWithLiveCycleForm.pdf
2) Run each of the following 5 code blocks

This fails ("read" + Acrobat):

<cfpdf action="read" source="#expandPath('./PDFWithAcrobatForm.pdf')#" name="myPDF">
<cfpdf action="write" source="myPDF" destination="#expandPath('./PDFWithAcrobatFormFlattened.pdf')#" overwrite="true" flatten="true">

Actual result: PDFInvalidDocumentVariableException "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."
Expected result: PDFWithAcrobatFormFlattened.pdf created

This fails ("merge" + LiveCycle):

<cfpdf action="merge" source="#expandPath('./PDFWithLiveCycleForm.pdf')#" pages="*" name="myPDF">
<cfpdf action="write" source="myPDF" destination="#expandPath('./PDFWithLiveCycleFormMergedFlattened.pdf')#" overwrite="true" flatten="true">

Actual result: PDFInvalidDocumentVariableException "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."
Expected result: PDFWithLiveCycleFormMergedFlattened.pdf created

This fails ("merge" + Acrobat):

<cfpdf action="merge" source="#expandPath('./PDFWithAcrobatForm.pdf')#" pages="*" name="myPDF">
<cfpdf action="write" source="myPDF" destination="#expandPath('./PDFWithAcrobatFormMergedFlattened.pdf')#" overwrite="true" flatten="true">

Actual result: PDFInvalidDocumentVariableException "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."
Expected result: PDFWithAcrobatFormMergedFlattened.pdf created

This fails ("merge" + LiveCycle + Acrobat)

<cfpdf action="merge" directory="#expandPath('./')#" name="myPDF">
<cfpdf action="write" source="myPDF" destination="#expandPath('./PDFFlattened.pdf')#" overwrite="true" flatten="true">

Actual result: PDFInvalidDocumentVariableException "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."
Expected result: PDFFlattened.pdf created

This works ("read" + LiveCycle):

<cfpdf action="read" source="#expandPath('./PDFWithLiveCycleForm.pdf')#" name="myPDF">
<cfpdf action="write" source="myPDF" destination="#expandPath('./PDFWithLiveCycleFormFlattened.pdf')#" overwrite="true" flatten="true">

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4051144

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:  
External Test Config: Verified in ColdFusion 11 Update 5 (build 11,0,05,293506).

Attachments:

  1. September 08, 2015 00:00:00: 1_PDFWithAcrobatForm.pdf
  2. September 08, 2015 00:00:00: 2_PDFWithLiveCycleForm.pdf

Comments:

Hi Adobe, That was a fast fix! All 5 code blocks now generate a PDF? Thanks!, -Aaron
Comment by External U.
5979 | September 15, 2015 12:39:30 AM GMT
To re-phrase: Adobe, can you confirm what was fixed? All 5 examples create a PDF?
Comment by External U.
5980 | September 15, 2015 01:18:47 PM GMT
I just encountered this same exact bug after migrating a project to ColdFusion 10,0,20,299202 (Windows) using java 1.8.0_77. (So works in CF9, broken in CF10, fixed in CF11.) I performed a "populate" action and directed the output to a variable. ColdFusion threw an error when attempting to perform a "write" action (& flatten to remove fields). <!--- Read original PDF & Personalize (in memory) ---> <cfpdfform action="populate" source="#PDFSourceTemplate#" name="thePDF"> <cfpdfformparam name="FieldToPopulate" value="Sample Data #ID#"> </cfpdfform> <!--- Flatten (in memory) ---> <cfpdf action="write" flatten="yes" source="thePDF" destination="#PDFTargetFile#" overwrite="yes"> Are there any workarounds other than "upgrading to CF11 or 2016"? I found another reference to this issue on Google Groups... in-memory manipulation is preferred & performed due to file locking: https://groups.google.com/forum/#!topic/coldfusion-talk/hzsrZuP_ULQ
Comment by External U.
5981 | July 25, 2016 02:03:14 PM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). All 5 examples create a PDF. Thanks!, -Aaron
Comment by Aaron N.
27849 | May 17, 2018 10:58:01 PM GMT