I tried to use     
 
afFormFields.SetExtraMargin(10000,10000);
 
did not see any visual effects either on this problem, or any shift for other textboxes, either multi-line or single line one. Looks like it has absolutely no effects. I change the margin to 10, 100,1000,10000.
 
thanks

Paulo Soares <[EMAIL PROTECTED]> wrote:
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
> data base 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 _javascript_ 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)
&g t; 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.
> /music.yahoo.com/unlimited/>
>


Yahoo! FareChase - Search multiple travel sites in one click.

Reply via email to