I just had this error too.  It was working fine in CF9.
Apparently CFPDF no longer likes to work all in memory, so I had to change my 
code to write the file to a temporary file after the CFPDFFORM and then use 
that temporary file as the source for the merged, flattened document:

<cfset tempfile = "SomeUniqueFileName.pdf">
<cfpdfform action="populate" source="#variables.SourcePDF#" 
 destination="#tempfile#" overwrite="true"> <cfpdfformparam name="fieldName" 
value="fieldValue">
</cfpdfform>
       
<cfpdf action="write" source="#tempfile#" destination="#variables.
DestinationFile#" flatten="yes" overwrite="yes">


> All:
> 
> Resending this as there were some issues when it was first posted and 
> no one has responded to it yet.  Any ideas here?  Thanks.
> 
> A client's web hosting company recently moved the website to a new 
> server (running CF10).  One function of the website is to take 
> information submitted by users and use that data to populate PDF forms 
> and then save them to disk.  That process is now resulting in the 
> following error message:
> 
> 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.
> 
> The code that is listed as the culprit is the last line of the 
> following:
> 
       
> <!--- Fill PDF form --->
       
> <cfpdfform action="populate" source="#variables.SourcePDF#" 
> name="pdfFile"> <cfpdfformparam name="fieldName" value="fieldValue">
              
> <!--- more of the above --->
       
> </cfpdfform>
> 
       
> <!--- Flatten PDF --->
       
> <cfpdf action="write" source="pdfFile" destination="#variables.
> DestinationFile#" flatten="yes" overwrite="yes">
> 
> This block of code is followed by several others that are just like it 
> except that the variables.SourcePDF and variables.DestinationFile 
> variables have different values in each.  Thinking that, maybe, the 
> problem was that the pdfFile variable was being used again (although 
> being reset with new content at the start of each such block) in 
> subsequent blocks, I added some code to explicitly reset the value of 
> pdfFile after each write/flatten.  I can't replace the variable with a 
> new one (e.g., pdfFile2) since some of those blocks are in loops that 
> iterate different amounts of times based on circumstances.
> 
> I've never seen this error before, certainly not while the website was 
> on the previous server.  Any ideas?
> 
> Thanks in advance.
> 
> --
> Mosh Teitelbaum
> [email protected] 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:354873
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to