From: Dan Chen [mailto:[EMAIL PROTECTED]
Sent: Monday, December 06, 2004 5:01 PM
To: Paulo Soares; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

>An /AP key is always needed to display the field.

 

My understanding is that the /AP key is only needed if you need some customized appearances like Rollover and Pushdown appearances for button.

 

No. Some versions of Acrobat Reader won't show anything if an appearance is not present.

 

>Acrobat will create one for you if it doesn't exist.

I use FOP + my codes to create PDF with Form

 

It's easy to fill the fields but not so easy to create the appearances.

 

>you'll need to get/setField for each field to create the appearances.

This work around works as below, but it wastes resources (time) as the values are already in the form.

       String[] fieldNames = (String[])form.getFields().keySet().toArray(new String[0]);

        for(int i = 0; i < fieldNames.length; i++)

        {

          form.setField(fieldNames[i], form.getField(fieldNames[i]));

        }

 

The values are in the form but the work that should have been done when you first created the form must be done sometime, even if behind the scenes by Acrobat. You just postponed the problem.

 

>if you just want to fill without flattening and are not interested in the appearances use AcroFields.setGenerateAppearances(false).

 

I’m interested in flattening form which already filled with values and don’t have appearances.

 

Then the appearances must be created.

 

Thanks.

 

 

Dan

 

 

-----Original Message-----
From:
Paulo Soares [mailto:[EMAIL PROTECTED]]
Sent
:
Monday, December 06, 2004 9:33 AM
To:
Dan Chen; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

 

An /AP key is always needed to display the field. Acrobat will create one for you if it doesn't exist. If you don't have appearances and want to flatten the fields you'll need to get/setField for each field to create the appearances.

By the way, if you just want to fill without flattening and are not interested in the appearances use AcroFields.setGenerateAppearances(false).

 

 


From: Dan Chen [mailto:[EMAIL PROTECTED]
Sent:
Monday, December 06, 2004 3:17 PM
To: Paulo Soares; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

It seems that there is not need to have /AP key for text field. Did the “fix for bold font” fix this problem too?

 

Dan

 

-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]
Sent:
Friday, December 03, 2004 3:59 PM
To: Dan Chen; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

 

Flattening only works with appearances and your file only has the fields filled and no appearances.

 


From: Dan Chen [mailto:[EMAIL PROTECTED]
Sent:
Fri 03-Dec-04 20:38
To: Paulo Soares; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

Paulo,

 

In the sample code I sent to you, if I comment out the following lines in method mergePDFAndFDF(…)

//FdfReader fdfReader = new FdfReader(fdf);

//AcroFields form = stamp.getAcroFields();

 //orm.setFields(fdfReader);

 

That means I don’t need to fill the fields with data from FDF, but I still want to flatten the fields. (in case I need to concat multiple PDF files which have same field name on them)

The fields all disappear in the output file.

What is correct way to flatten the fields without merging FDF data?

 

Thanks.

 

Dan

 

-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]
Sent:
Friday, December 03, 2004 5:40 AM
To: Dan Chen; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

 

It's a semi-bug. If you take your pdf and do a "save as" in Acrobat then the field merge and flattening will work correctly. In any case I've changed iText to support this kind of PDF. If you have urgency I can send you the changed source file.

 

Best Regards,

Paulo Soares

 


From: Dan Chen [mailto:[EMAIL PROTECTED]
Sent:
Thursday, December 02, 2004 7:43 PM
To: Paulo Soares; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

Paulo,

 

Thanks. Attached are the zipped PDF and FDF files (don’t unzip it) and the java code. Comment out stamp.setFormFlattening(true) to see the difference.

 

Dan

 

-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]
Sent:
Thursday, December 02, 2004 9:39 AM
To: Dan Chen; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Bold font changed to plain font after flattening

 

I need the the pdf and the code so that I can reproduce the problem.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Chen
Sent:
Thursday, December 02, 2004 3:15 PM
To: [EMAIL PROTECTED]
Subject: [iText-questions] Bold font changed to plain font after flattening

Hi,

 

I have a form field as below:

 

17 0 obj

<</Type/Annot/AP<</N 8 0 R>>

/F 4

/T(patient.name.fn)

/BS<</W 0>>

/V(Smith)

/Ff 1

/Rect[56.692 660.214 93.062 648.214]

/Subtype/Widget

/DA(/HeBo 10.0 Tf 0 g\n)

/FT/Tx>>

endobj

 

The name was displayed as bold font before flattening. After flattening, the name was changed to plain font.

Does anyone know why? If I want to keep the bold font after flattening, what I need to do?

 

Thanks in advance

 

Dan

Reply via email to