“Expected dict” Errors in FDF Acrobat Forms
October 24th, 2005 by Kelson. Posted in Troubleshooting, Web Design and tagged for Acrobat, adobe, ColdFusion, error, FDF, form, PDFToday I was trying to fix a problem in a section of a website that hadn’t been changed in roughly 5 years. The page in question retrieved data from a database and filled out an Acrobat form using FDF. Under some circumstances, Adobe Reader would generate an error message, “Expected a dict object.” Then it would freeze, and crash the web browser for good measure.
This site was built with ColdFusion, and used a then-freely-available library called PDFFormFiller.cfm (I can’t find any sign of it now) to generate the FDF code. After saving the offending FDF to a file (eliminating the browser as a factor), I started manually editing the code to see what happened.
The problem turned out to be parentheses appearing in the form data. FDF uses parentheses-delimited strings, and it was finding ) in the code and trying to parse what was left as FDF tokens. The solution was simple: just escape the parentheses as \( or \).
In this case, I changed this expression:
#Evaluate("VarStruct.#VarName#")#
to
#ReplaceList(Evaluate("VarStruct.#VarName#"),"(,)","\(,\)")#
I don’t know whether older versions of Acrobat Reader were more lenient about this or whether this site just never ran into anyone using parentheses before. Either way, there’s precious little useful information about this problem online. In case anyone else runs into it, this entry should help.
Related Posts
- Hey WaSP Webmaster: How to Fix Acid2
- Taking the Web Beyond the Typewriter
- Acid(2) Stare
- WordPress Broken on PHP 5.2 Again
- Consolidated Amalgam: Adobe buys Macromedia



9 Responses to ““Expected dict” Errors in FDF Acrobat Forms”
By Doug on Nov 17, 2005
I also had the problem with a misplaced “>”. It seems that Acrobat 7 is much more picky with formatting.
By Charles on Jan 16, 2006
Thanks, I ran accross this after experiencing a parenthesis problem (I wanted to make certain i could escape those characters with a \). Found you via google.
By Keoki on Mar 7, 2006
Hello:
I seemed to have the same error. As, I am new to FDF and populating PDF’s through an asp page, I have no idea what this error means. The FDF is within the ASP file, The funny part is it worked once… I changed a few attributes. And, whammy no luck.
Any ideas?
By Brian S on Apr 4, 2006
Thanks, I was going crazy trying to figure this error out. I googled the ‘Expected dict’ error and found this blog. Our site pulls fdf data from our dbase to populate a pdf form. Turns out users were entering parenthesis in a phone number field causing Adobe to hang and “crash the web brower for good measure”. Manipulated the php code to strip parenthesis and works great now!
By Barbara on Apr 20, 2006
Found this on by googling expected a dict object. I am having an issue with a site that we just took over for a client that swears this used to work.
problem is i program in cf and the site is built in asp. how do I do the escapes in asp.
for example if i have a field
writeField “ERPhone”,rs(”phone”)
how would i do the escape for parentethis.
By think_Man on Sep 25, 2006
Thanks for this blog I was also going crazy….
By Domingo on Sep 29, 2006
Results:
1. “The file is damaged and could not be repaired”.
2. “Expected a dict object.”
Two problems occur when a form is submitted (Opened) with a single or close bracket in a textbox.
Steps to reproduce bug:
1. Single close Bracket “(” causes 1.
2. Single open Bracket “(” causes 2.
3. When an unpaired “)(” is used in a textbox causes 2.
These files are either submitted or read in IE 6.0.
One solution would be before submitting a form to run a js to change all “()” to “[]“.
Domingo
By Cliff on Aug 21, 2007
I get this error and I have no forms on my PDF. ANy ideas?
By Caz on Nov 7, 2007
I have this message when trying to open documents from internet since downloading version 8, but not with all documents. I do not have a danny about brackets forms etc. just want access as I used to have. Should I go back to old version?