tracker issue : CF-3338219

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

cfpdfform does not release handle on written file

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Mosh Teitelbaum / Mosh Teitelbaum (Mosh Teitelbaum)

Created: 09/27/2012

Components: Document Management, PDF Form

Versions: 9.0

Failure Type: Crash

Found In Build/Fixed In Build: 9.0 /

Priority/Frequency: Critical / All users will encounter

Locale/System: ALL / Win 2008 Server x64

Vote Count: 2

Problem Description:When using cfpdfform to populate form fields within a PDF file, ColdFusion does not release the file handle to the written file upon completion.  All subsequent attempts to manipulate the written file, whether with cfpdf or cffile or directly via the file system, results in an error along the lines of "another process is using this file."  In order to release the lock on the file, the CF service needs to be restarted.

Steps to Reproduce:<cfpdfform action="populate" source="source.pdf" destination="destination.pdf">
<!--- populate form fields --->

<!--- All attempts to manipulate the file, such as with the below, causes an error --->
<cfpdf action="write" source="destination.pdf" destination="destination.pdf" flatten="yes" overwrite="yes">

Actual Result:PDF file written via the cfpdfform tag is not flattened and an error is generated upon trying to flatten the file.

Expected Result:PDF file is flattened, process completes without error, and CF releases lock on file.

Any Workarounds:For now, all PDF manipulation on newly created PDF files can be performed in memory and then written only when all manipulations have been completed.  However, CF still maintains a lock on the file so if you need to return at a later time to further manipulate the file (update contents, move, delete, etc.) the error message is still generated and the process fails.

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

Watson Bug ID:	3338219

External Customer Info:
External Company:  
External Customer Name: Queevert
External Customer Email:  
External Test Config: My Hardware and Environment details:



I have a situation where I need to populate a pre-made PDF form template with values entered by the user on the website. In the finished PDF, I need that form to no longer be editable. Unfortunately, CFPDFForm locks the file, so I cannot flatten the file using the CFPDF tag. One workaround is to write the unflattened PDF to a temp location, then write the finished PDF file using CFPDF. But, since I cannot delete the unflattened PDF, it will stay there indefinitely.
Vote by External U.
17864 | December 19, 2012 12:08:12 PM GMT
Using temp files each time is a valid workaround but it leaves the file system cluttered on busy systems
Vote by External U.
17865 | August 08, 2013 06:57:49 AM GMT