Skip to main content
Known Participant
January 31, 2011
Question

CF 9, iText PDF creation, MySQL database: Apostrophe disappears in output PDF

  • January 31, 2011
  • 1 reply
  • 5967 views

I create PDF files using iText. I insert variable data from a MySQL database into form fields (in an existing PDF file). I have an entry in the database "O'Malley" and (only on the output PDF file) the apostrophy is dropped, resulting in "OMalley". The name displays correctly in the database and in online cfm pages. All other special characters that I have tried display correctly in the PDF files as well as online pages. Any assistance would be appreciated.

    This topic has been closed for replies.

    1 reply

    Inspiring
    January 31, 2011

    Can you post a small (stand-alone) example that reproduces the problem?

    Known Participant
    January 31, 2011

    Are you requesting a URL or the code that is used to create the PDF file?

    Inspiring
    February 1, 2011

    You have attempted to dereference a scalar variable of type class coldfusion.runtime.Array as a structure with members.

    5 : <cfscript>
    6 : arr = listToArray(inputdata.fullname, "");
    7 : for (x in arr) {
    8 :     WriteOutput( asc(x) &"="& x &"<br>");
    9 : }
    

    It does run under CF9.0.1. Though the syntax was borderline / lazy of me ;-)

    Anyway, you are just trying to loop through the string, and output each character plus its ascii value.  Try a regular loop with string functions.

    <cfloop from="1" to="#len(inputdata.fullName)#" index="x">
        <cfset currChar = mid(inputData.fullName, x, 1)>
        <cfoutput>
        #asc(currChar)# = #currChar#<br>
        </cfoutput>
    </cfloop>