Nick Watts wrote:
> Hello.  I am seeing some strange behavior in a PDF I'm generating with 
> iText 2.1.4 and I'm not sure if the problem is my code, my data, iText, 
> or the Adobe plug-in. 
> 
> My scenario is that I'm pulling data stored as a CHAR data type in an 
> OS/400 DB2 database and using the PDFStamper to insert that data into 
> fields of an AcroForm.  The CHAR data type is encoded with EBCDIC.  This 
> is being done by a servlet in a web application (WebSphere 6.1, Java 
> 1.5).  The problem I'm having is with the way apostrophes are appearing 
> in the PDF once it has been generated and is viewable in the web 
> browser.  For example, I have the text "Moe's Tavern" stored in the 
> database, but this turns into "Moe©s Tavern" in the generated PDF (the 
> apostrophe has turned into a copyright symbol).  The strange thing is 
> that the copyright symbol only appears if the field does not have the 
> focus.  As soon as I give the field focus, by clicking in it or tabbing 
> to it, the apostrophe is displayed correctly. 
> 
> The way the data is being stored is that I the form is submitted to the 
> servlet with a submit button on the PDF.  The servlet is using the 
> FDFReader to get the field values and store them in the database with a 
> simple SQL insert or UPDATE statement (no relational data framework or 
> anything like that in between). 
> 
> I worked with my database admin to make sure that the apostrophe was 
> actually being stored in the table correctly, as opposed to just being 
> displayed correctly by the software I was using to query the database.  
> As far as we can tell the character code is correct for the apostrophe. 
> 
> Does anyone have any ideas on what might be causing this problem?

As you say in the Subject line, it's an encoding problem.
The problem could be caused by the way you get the result from the 
database. What is the encoding of the Java String object you are using?
(Consult the api for java.lang.String and look for charsetname.)

-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to