Well, the biggest problem you have is that the form is created with Adobe
Designer - thus making it an XFA-based form. HOWEVER, you are treating it as an
AcroForm in your code. You can't mix them - if you are going to work with XFA,
then work with XFA. If you want AcroForms, then make one of those.
Leonard
From: David Palomar [mailto:[email protected]]
Sent: Thursday, September 10, 2009 6:25 AM
To: Leonard Rosenthol
Cc: [email protected]
Subject: Re:
Re%3A%20%5BiText-questions%5D%20Special%20characters%20on%20input%20forms
Hello,
according to the problem described in
http://thread.gmane.org/gmane.comp.java.lib.itext.general/47009/focus=47022
we have desgined another pdf to show the problem with multiple line form
filling. In the template form "template.pdf" you can find three columns
with four input forms each one. Beginning with the first two that
are single line and the last two that are multiple. You can clearly see
in the resulting output pdf "01234.pdf" how the first line in each column
(regardless if its aligned on top, middle or bottom) is uppertrimmed with
the result that an À or Á looks like an A and a Ñ looks like a N.
If you look the 2nd and 3rd line you see these characters correctly so it
suggests that the problem has nothing to see with the height of the field.
I would like to know if it's a problem from Adobe or from IText and if
anyone has experienced such a problem.
Thanks in advance!
PD: the source code is the next:
try {
PdfReader reader = new PdfReader("c:/bak/template.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 +"\n");
form.setField(key,
"ÀÑ,1.2,ÀÈÌÒÙÁÉÍÓÚÑÑÑ\r\nÀÈÌÒÙÁÉÍÓÚÑÑÑ\r\n0123456789\r\n0123456789");
//form.setField(key, "0,1.2,ÀÈÌÒÙÁÉÍÓÚÑÑÑ");
}
//loByteContent.bezierArc(1, 2, 3, 4, 5, 6);
//stamp.insertPage(1, PageSize.A4);
stamp.setFormFlattening(true);
stamp.setFullCompression();
stamp.close();
}
catch (Exception de) {
de.printStackTrace();
}
On Thu, Sep 10, 2009 at 8:51 AM, Leonard Rosenthol
<[email protected]<mailto:[email protected]>> wrote:
Yes, because the height of the fields does NOT match the height of the font.
You need to edit the fields of the form to make them taller OR choose a smaller
point size font.
Leonard
On 9/10/09 8:22 AM, "David Palomar"
<[email protected]<http://[email protected]>> wrote:
Hallo,
I have read in
http://www.mail-archive.com/[email protected]/msg46953.html
your response:
<<
The fields in the form are too short for the font/size being used - edit the
form.
Leonard
On 9/9/09 10:34 AM, "David Palomar"
<[email protected]<http://[email protected]>> wrote:
Hello everyone,
We have just detected a little problem when filling an AcroForm input
with text and special characters like the sequence:
"ÀÈÌÒÙÁÉÍÓÚÑÑÑ\r\nÀÈÌÒÙÁÉÍÓÚÑÑÑ\r\n0123456789\r\n0123456789"
We clearly see in the resulting pdf "01234.pdf" how the letters
À ... Ñ are uppercut...so, an Ñ seems to be an N ...
I think it is not directly related to IText *but* I'm just
asking it here if anyone experienced the same problem.
Thanks in advance!
PD: the sourcecode looks like
>>
You misunderstood me... the inputs are large. The fact is that the uppercut
letter seems to be always the 1st line
in a multiline input form. Take a look on the attached PDF (download it from
the forum).
Thank you in advance!
--
Leonard Rosenthol
PDF Standards Architect
Adobe Systems
------------------------------------------------------------------------------
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
[email protected]
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/