Okay, I spent half the day trying to figure out how to capture the existing 
text field appearance attributes and then copy them back to the text field when 
I insert the text, but I've had no luck. An example would be great. I've been 
trying to use GetAppearance method, but am having problems invoking it and I 
don't know anything about these pdfdictionaries, or if this is even the way I 
should be trying to accomplish my goal? Can appearances have something to do 
with the weird shifting that is taking place? Alternatively, I tried but failed 
to find an example of using the form field coordinates and columntext to create 
a flattened field. I searched the mailinglist and checked the docume ntation 
and tried using the API too, but couldn't quite get it working. Lastly, if I 
used the TextField approach to build the appearance, I would still need to 
capture the appearance values from the original form because I can't hardcode 
all of my form fields properties. Examples would be most helpful, thank you!

At 03:17 PM 8/31/2005, you wrote:

>Text layout in form fields is not documented. iText tries to approximate
>Acrobat 5 layout but it's not exact and if you go to newer Acrobat versions
>it's even worse. You can change or duplicate TextField to suit your needs
>or, better yet, as you are flattening just get the coordinates of the field
>and write the text directly on it.
>
>----- Original Message ----- 
>From: "Chris Miller" <[EMAIL PROTECTED]>
>To: <[email protected]>
>Sent: Wednesday, August 31, 2005 7:26 PM
>Subject: RE: [iText-questions] Form field text shifting after setField?
>
>
>> Regardless, there is definitely something not right about the way the text
>is dropped into the field and the problem we are seeing is occurring across
>versions, did you test the demo? I just need a solution asap so that I can
>start taking orders :) Please take a second look for me and/or suggest a
>viable alternative. Thanks Paulo.
>>
>> At 06:15 AM 8/31/2005, you wrote:
>>
>> >The form field text layout is not even the same across Acrobat versions.
>> >
>> >> -----Original Message-----
>> >> From: [EMAIL PROTECTED]
>> >> [mailto:[EMAIL PROTECTED] On
>> >> Behalf Of Chris Miller
>> >> Sent: Wednesday, August 31, 2005 10:50 AM
>> >> To: [email protected]
>> >> Subject: [iText-questions] Form field text shifting after setField?
>> >>
>> >> Hi everyone, thanks in advance for your support. I'm
>> >> experiencing some problems filling form fields on the fly. I
>> >> have seen a number of other posts regarding this issue to no
>> >> avail, however, I'm confident it can be resolved. The problem
>> >> involves the movement or shifting of form field text
>> >> following the usage of the setField or setFields methods of
>> >> the class AcroFields. The problem is especially apparent with
>> >> multi-line text boxes and with text boxes that utilize the
>> >> "resize text to fit box" feature.
>> >>
>> >> I allow users to fill out a PDF form, submit it back to the
>> >> server, and then I use the form values they submitted to fill
>> >> and flatten the same form on my server. However, when I (or
>> >> the user) opens up the resulting PDF document the text within
>> >> the form fields has moved drastically, which is not good
>> >> given the "print ready" file we are trying to output. I have
>> >> used both the HTML PDF submit and the FDF submit methods of
>> >> submitting the PDF form, but experienced the same problem, I
>> >> thought that the form field attributes (e.g. padding) weren't
>> >> being passed or something so I was surprised that the FDF
>> >> submit method did not work. Either way, the problem can be
>> >> very clearly seen by accessing the URL below, you'll have to
>> >> upload one image to see the first preview, then you can
>> >> submit the form to the server, add the product to your
>> >> shopping cart, and then press "view artwork" to see the
>> >> flattened artwork where the multiline text boxes are clearly
>> >> messed up (text is shifted up and to the left).
>> >>
>> >> http://www.adsoftdirect.com/index.cfm?page=previewPdf&producti
>> >> d=128&templateid=3&storefrontid=6
>> >>
>> >> The current code that makes this possible is way simple,
>> >> which is why I think the problem may be with iText, excuse
>> >> that it's done in cold fusion script, but you get the idea...
>> >> fdf = createObject("java",
>> >> "com.lowagie.text.pdf.FdfReader").init(FDFByteArrayData);
>> >> form1 = stamp.getAcroFields();
>> >> form1.setFields(fdf);
>> >>
>> >> Also, I've seen it noted before that this problems is related
>> >> to the different versions of acrobat/reader, however this
>> >> problem is occurring across the board with all versions of
>> >> acrobat and reader and a closer inspection of the generated
>> >> PDF shows that the text has in fact moved before being
>> >> flattened or it is not being inputted into the field properly
>> >> in the first place.
>> >>
>> >> I know that it is possible to capture the form field
>> >> coordinates and use columnText to "recreate" the text on the
>> >> PDF, but this is hardly a long-term solution and would not
>> >> take advantage of the "scale font size to fit" functionality
>> >> which has numerous implications in terms of generating print
>> >> ready documents. So if we could find a way to make this work,
>> >> even gulp, if it involves modifying the underlying iText
>> >> library, then I would be very gracious...I've been developing
>> >> our technology for over two years and iText has been great,
>> >> this is the last hurdle I've got to overcome so any help
>> >> would be much appreciated. Thanks!
>> >>
>> >>
>> >>
>> >> -------------------------------------------------------------
>> >> Chris Miller - President/CEO
>> >> AdSoft Direct, Inc.
>> >> 1-888-3-ADSOFT (1-888-323-7638)
>> >> Office:       925-251-0566
>> >> Cell:          510-504-5006
>> >> E-mail:      [EMAIL PROTECTED]
>> >> Web:        http://www.adsoftdirect.com
>> >>
>> >>
>> >>
>> >> -------------------------------------------------------
>> >> SF.Net email is Sponsored by the Better Software Conference & EXPO
>> >> September 19-22, 2005 * San Francisco, CA * Development
>> >> Lifecycle Practices
>> >> Agile & Plan-Driven Development * Managing Projects & Teams *
>> >> Testing & QA
>> >> Security * Process Improvement & Measurement *
>> >> http://www.sqe.com/bsce5sf
>> >> _______________________________________________
>> >> iText-questions mailing list
>> >> [email protected]
>> >> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> >>
>>
>>
>>
>> -------------------------------------------------------
>> SF.Net email is Sponsored by the Better Software Conference & EXPO
>> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
>Practices
>> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
>> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
>> _______________________________________________
>> iText-questions mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to