Unicode (international) characters in cfpdfform with LiveCycle PDFs
Hi all
These are the details of my environment:
ColdFusion version: 8.0.1
Update level: C:/ColdFusion8/lib/updates/chf8010004.jar
Server OS: Windows Vista 64
Web server: Apache
I'm using cfpdfform in ColdFusion 8 to read a Livecycle 8.2.1 pdf form straight into the browser window, enter text into a couple of fields and then submit the form back to the same CF page and use the submitted XML to populate the same form.
So, the relevant bit of my code is as follows:
<cfif IsDefined("PDF")>
<cfpdfform action="read" source="#PDF.content#" xmldata="myXMLData" />
<cfset myXMLData = XMLParse(myXMLData)>
<cfpdfform action="populate" source="c:\temp\myPDFForm.pdf" xmldata="#myXMLData#" overwritedata="true" />
<cfelse>
<cfpdfform action="populate" source="c:\temp\myPDFForm.pdf">
<cfpdfsubform name="topmostSubform">
<cfpdfformparam name="TextField1" value="Hello! The time is #TimeFormat(Now(), 'HH:mm:ss')#" />
</cfpdfsubform>
</cfpdfform>
</cfif>
This all works just fine, except that any multibyte unicode characters (e.g. Chinese) I enter into any text fields are lost (turned to question marks) when the form is populated from the submitted XML, even though I can see that the Unicode characters remain intact if I do a cfdump of the myXMLData variable on page submission.
I ordinarily have no problems with Unicode. I can write unicode characters in multiple foreign character sets to database and retrieve them just fine. I have site pages in several international character sets, and, as I have stated, the text I enter is displayed correctly in the correct foreign characters when I view a cfdump of the submitted form, so this appears to be specifically related to the PDF form populate side of things (or a setting in LiveCycle).
I have an inkling that the cause is that the LiveCycle form has its text fields set to allow rich text and has a specific font set against the fields, so I'm wondering whether the foreign character font, which displays fine when I enter it into the form, is being lost (overwritten by the LiveCycle field font) when read back into the form. Any ideas as to how to overcome this problem would be gratefully accepted.
