Hi!

The version I'm using of ITEXT is 2.1.7

I'm having some problems with leading space between lines in AcroFields. If
i open with Adobe Reader
the original pdf file trf2_c_25.pdf and edit the second field (the big one)
i can make
enters and begin a new line with the desired space.

IF i do the same programatically via ITEXT the result is that the line space
between lines is not respected. The source code is below:

 public void test1()
 {
  try {
            PdfReader reader = new
PdfReader("c:/bak/trf2_c_25.pdf");
            PdfStamper stamp = new PdfStamper(reader, new
FileOutputStream("c:/bak/01234.pdf"));

            AcroFields form = stamp.getAcroFields();
            HashMap fields = form.getFields();
   String key;
         for (Iterator i = fields.keySet().iterator(); i.hasNext(); )
   {
    key = (String) i.next();
    System.out.print(key + ": ");

    form.setField(key, "0123456789\r\n0123456789\r\n0123456789");
   }

   stamp.setFormFlattening(true);
         stamp.setFullCompression();
   stamp.close();
        }
        catch (Exception de) {
            de.printStackTrace();
        }


 }


I believe this is a limitation / bug from the ITEXT package.

Just reading from  "Document management — Portable document format — Part 1:
PDF 1.7"
in chapter:
 9.3. Text State Parameters and Operators

I found a table where the basic operators are defined for text:

Character spacing
Word spacing
Horizontal scaling
Leading
...
...
Text knockout


Maybe is that ITEXT cannot interpertet the Leading Operator correctly...
isn't it?
Or maybe it comes from the Acrofield element... but the Adobe Reader shows
it perfectly so
I think that the Adobe Reader is interpreting it fine....



Why is this happening?
Should I change some property for the AcroField or in the Stamper?
Any idea?



Thank you!
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to