Thanks,
here's some more detail on my code:


//create a new form text field
PdfFormField field = form.addSingleLineTextField("testField","defaultValue",BaseFont.createFont(BaseFont.COURIER, "winansi", false),5,
origPos[1]+m_fields_offset_x,
origPos[2]+m_fields_offset_y,
origPos[3]+m_fields_offset_x,
origPos[4]+m_fields_offset_y
);


//extract template field info
PdfDictionary oldInfo = reader.getAcroForm().getField("testField").getInfo();

//make the new field inherit template field info
field.putAll(oldInfo);

//add new field to the final document
writer.addAnnotation(field);



Everything seems to work except for the border. It seems like there's no way to get rid of the default border. The starting field had a flat (invisible) border the generated field loses such info.
I tried with both...


field.setBorder(....);

or

field.setBorderStyle(....);


but no change will be applied to the final field's border.



Best regards, Riccardo





At 16.21 22/03/2004, Paulo Soares wrote:
It's not possible to import just the fields from other documents. Other
options exist but more details are needed.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of lowdown
> Sent: Monday, March 22, 2004 12:19 PM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Moving form fields
>
> Hi,
> I'm generating a Pdf document starting from a template. In the final
> document I need to shift every form field before applying FDF
> and then
> flattening.
>
> I would like to preserve every original field info (without
> the need to
> re-create everything again). Basically I would like to read field's
> constant info from the PdfReader form then creating a new one
> on the Writer
> setting just the position (lx,ly,ux,uy) without messing with
> new appearences...
>
> Something like this (logically speaking):
>
> field_info = readerForm.get_form_info;
> new_field = new field(field_info);
> new_field.set_position( my new coordinates );
> writer.addAnnotarion(new_field);
>
>
> Is it possible? Any suggestion?
>
> Thanks
> Riccardo
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>



------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to