That's an XFA form and only SetField() will work. What error did you get?

Paulo 

> -----Original Message-----
> From: JK Park [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 24, 2008 10:55 AM
> To: [email protected]
> Subject: [iText-questions] (no subject)
> Importance: High
> 
> Hi,
>  
> I am developping PDF rendering application using iTextSharp. 
> I want to set field values on exsiting PDF form in Korean 
> Characters. I encountered error when I tried to setfield with 
> Korean character.
> Please review attached code snip to solve the problem. I 
> count not find this kinnd information on the iText in Action manual..
> Thank you in advance,
>  
>  
> using System;
> using iTextSharp.text.pdf;
>  
> public partial class _Default : System.Web.UI.Page 
> {
>   private void Page_Load(object sender, System.EventArgs e)
>   {
>    Response.ContentType = "application/pdf";
>    Response.AddHeader("Content-disposition", "attachment; 
> filename=token.pdf");
>  
>    PdfReader pdfReader   = new 
> PdfReader(Request.MapPath("~/assets/EGReceipt2.pdf"));
>    PdfStamper pdfStamper  = new PdfStamper(pdfReader, 
> Response.OutputStream);
>    pdfStamper.FormFlattening = true; // generate a flat PDF 
>    AcroFields pdfForm   = pdfStamper.AcroFields;
>  
>             BaseFont unicode = 
> BaseFont.CreateFont("D:\\PDFGen\\Assets\\AdobeMyungjoStd-Mediu
> m.otf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
>    
>    pdfForm.SetFieldProperty("Title[0]","textfont", unicode, null);
>    pdfForm.SetFieldProperty("Name[0]","textfont", unicode, null);
>    pdfForm.SetFieldProperty("FeeName1[0]","textfont", unicode, null);
>    pdfForm.SetFieldProperty("FeeName2[0]","textfont", unicode, null);
>    pdfForm.SetFieldProperty("FeeName3[0]","textfont", unicode, null);
>    pdfForm.SetFieldProperty("Title[1]","textfont", unicode, null);
>  
>     pdfForm.SetField("Title[0]", "6월 교육비");
>    pdfForm.GetField("Title[0]");
>    pdfForm.SetField("Name[0]", "김준환");
>    pdfForm.SetField("FeeName1[0]", "교육비");
>    pdfForm.SetField("FeeName2[0]", "교재비");
>    pdfForm.SetField("FeeName3[0]", "교통비");
>    pdfForm.SetField("FeeName4[0]", "기말고사료");
>    pdfForm.SetField("CFee1[0]", "230,000");
>    pdfForm.SetField("CFee2[0]",  "90,000");
>    pdfForm.SetField("CFee3[0]",  "15,000");
>    pdfForm.SetField("CFee4[0]",  "50,000");
>    pdfForm.SetField("CSum[0]", "385,000");
>    pdfForm.SetField("PFee1[0]", "");
>    pdfForm.SetField("PFee2[0]",  "");
>    pdfForm.SetField("PFee3[0]",  "");
>    pdfForm.SetField("PFee4[0]",  "");
>    pdfForm.SetField("PSum[0]", "");
>    pdfForm.SetField("Total[0]", "385,000");
>  
>    pdfForm.SetField("Title[1]", "6월 교육비");
>    pdfForm.SetField("Academy[1]", "잉글리쉬 가든");
>    pdfForm.SetField("Name[1]", "이선미");
>    pdfForm.SetField("FeeName1[1]", "교육비");
>    pdfForm.SetField("FeeName2[1]", "교재비");
>    pdfForm.SetField("FeeName3[1]", "교통비");
>    pdfForm.SetField("FeeName4[1]", "기말고사료");
>    pdfForm.SetField("CFee1[1]", "230000");
>    pdfForm.SetField("CFee2[1]",  "90000");
>    pdfForm.SetField("CFee3[1]",  "15000");
>    pdfForm.SetField("CFee4[1]",  "50000");
>    pdfForm.SetField("CSum[1]", "385000");
>    pdfForm.SetField("PFee1[1]", "");
>    pdfForm.SetField("PFee2[1]",  "");
>    pdfForm.SetField("PFee3[1]",  "");
>    pdfForm.SetField("PFee4[1]",  "");
>    pdfForm.SetField("PSum[1]", "");
>    pdfForm.SetField("Total[1]", "385000");
>  
>  
>    pdfStamper.Close(); 
>  
>   }
>  
>   #region Web Form 디자이너에서 생성한 코드
>   override protected void OnInit(EventArgs e)
>   {
>    //
>    // CODEGEN: 이 호출은 ASP.NET Web Form 디자이너에 필요합니다.
>    //
>    InitializeComponent();
>    base.OnInit(e);
>   }
>   
>   /// <summary>
>   /// 디자이너 지원에 필요한 메서드입니다.
>   /// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
>   /// </summary>
>   private void InitializeComponent()
>   {    
>    this.Load += new System.EventHandler(this.Page_Load);
>   }
>   #endregion
>  }
>  
>  
> JK Park
> 
> AllimNet Corporation
> Tel: +82 2 2108 6181
> Fax: +82 2 2108 6189
> 

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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