Each Acrobat version has a different text layout. Use
AcroFields.setExtraMargin() to adjust it. 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Alan Zhang
> Sent: Tuesday, October 18, 2005 11:58 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Characters shift up and down in 
> edtiable multi-line textbox
> 
> I am using iText C# version  (iTextSharp) to write a ASP.NET 
> application.
>  
> Basically, I have a template file (created with Acrobat 7.0 
> pro) containing several user editable textboxes, some of them 
> are multi-line ones. I use PdfStamper to read in the template 
> file, and write to another file, then set fields from 
> database by SetField(String name, String value) from AcroFields.
>  
> When the pdf file is loaded up inside client browser, I click 
> inside the multi-line text box (font is times roman), the 
> characters shift down. Clicking outside the field, the 
> characters shift up to their original position. If I edit the 
> data, say add just one character or space at the end, I no 
> longer see the shift. 
>  
> I do not know whether this is related to iText way 
> manipulating pdf file, since if I open the template file 
> directly, I do not see the character shift. Has anyone seen 
> such problem, or I missed something. Thanks.
>  
> Here is my code:
>  
>       
>    // we create a reader for a certain document
>    PdfReader reader = new PdfReader( "template.pdf");
> 
>    //Set export file name, which is identified by session id
>    String  myExportFile ="test" + 
> Session.SessionID.ToString()  + ".pdf";
>  
>    //Create a file stream with the export file. 
>    FileStream myFileStream= new FileStream(myExportFile, 
> FileMode.Create);
>  
>    //Create a PdfStamper, which read in template pdf from 
> reader, and output to export file
>    PdfStamper myStamp = new PdfStamper(reader, myFileStream);
>  
>    //Get all fields from the pdf file
>    AcroFields afFormFields = myStamp.AcroFields;
>  
>    if(Request.QueryString["print"]=="1")
>    {
>     //Add java script to the pdf file, so it will be 
> automatically printed without prompting user
>     myStamp.JavaScript = "this.print(false);";
>    }
>  
>    //Get the working object id
>    int ID = Convert.ToInt32( Request.QueryString["g_ID"] );
>  
>    //Construct working object
>    TWorking temp = new TWorking (ID);
>  
>    // filling in the form with setfileds(string, string)
>    temp.FillFormWithData(afFormFields);
> 
>    //close the stamper
>    myStamp.Close();
> 
>    //close the reader
>    reader.Close();
>  
>    Response.ClearContent();
>    Response.ClearHeaders();
>    Response.ContentType = "application/pdf";
>    Response.WriteFile(myExportFile);
>    Response.Flush();
>    Response.Close();
>    System.IO.File.Delete(myExportFile);
>  
> 
> ________________________________
> 
> Yahoo! Music Unlimited - Access over 1 million songs. Try it 
> free. 
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http:/
/music.yahoo.com/unlimited/> 
> 


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to