By Date: <-- -->
By Thread: <-- -->

Form filling problem at the pdf file edited using Acrobat



Hello.
 
I have developed applications using iTextSharp.
 
I faced to fatal problem that I could not solve. - I bought your book(iText in Action) and read but I could not find solution.
 
 
The problem is as this;
 
 - When I fill the acroforms at the PDF file that I draw text fields using Acrobat, error occurred.
 
 
I made the template PDF file as following steps;
 
1. I launched MS Word 2003 Korean Edition and draw simple table.
2. I converted it to PDF using Adobe's MS Word Addin menu.
3. I opened created PDF file and inserted text fields.
4. I set the font name of text fields to Batang(default font of Korean Windows).
5. I typed strings at the text fields and exported meta data to a xfdf file.
6. I deleted typed strings and saved because I would use the PDF file as template.
 
 
Therefore, I got a PDF file and xfdf file.
 
 
 
And then... I wrote VB.NET codes as followings;
 
 
    Private Sub FillData(ByVal SourceName As String, ByVal xfdfName As String, ByVal OutputName As String, ByVal bFlattening As Boolean)

        Dim reader As PdfReader = New PdfReader(SourceName)
        Dim stamp As PdfStamper = New PdfStamper(reader, New FileStream(OutputName, FileMode.Create))
        Dim forms As AcroFields = stamp.AcroFields ()
        Dim xfdfReader As New XfdfReader(xfdfName)

        forms.SetFields(xfdfReader)   ' ==> error occurred at this line!

        stamp.FormFlattening = bFlattening 
        stamp.Close()
        reader.Close()

    End Sub

 
When I executed it, this error occurred;
 
Font 'HYSMyeongJoStd-Medium' with 'UniKS-UCS2-H' is not recognized.
 
 
When I tested with the sample PDF files at iText Tutorial and a xfdf file that contained only English chars, above code worked.
 
I suppose that Acrobat may add additional font information about CJK font pack. - HYSMyeongJoStd-Medium font is a part of Adobe's CJK font pack.
 
 
I also tested as this;
 
 I uninstalled Adobe's CJK font pack and launch Acrobat and tried to modify the font of text filed to a Korean TTF font.
But, Acrobat showed me the message box -"CJK font pack needed" - and canceled my work.
 
I also tried as followings;
 
1. I added the reference of iTextAsian-1.0.dll and iTextAsianCmaps-1.0.dll but the result was same.
2. I added the code -" FontFactory.RegisterDirectories()" -  but the result was same.
 
 
Indeed, I have been troubled by the form filling of Korean characters for a long times.
 
I used the iTextSharp 3.1.5 and 3.1.8 and tested with Acrobat 7 and 8.
 
 
 
Finally, I attached my codes, PDF file and xfdf file.
 
 
 
If you could take a few minutes to answer my questions, I would really appreciate it.
Thank you in advance for your help.
 
 

Best regards,

S. H. Park

Attachment: xfdfTest.rar
Description: Binary data

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/