Yeah, it is quite obvious from the stacktrace that "F3" is a font name, but
where does this name come from? What other names should I expect? (Of
course I can collect all of the font names referenced in the document, and
assign a PDType1Font value to them, but this is more like a hack then a
proper solution.)

The pdf document (and form) I'm trying to flatten is created from the
following source file (
https://drive.google.com/file/d/0Bx_3O22Jn2egYWlfazJrNzA2RGc/view) by
adding the pages and the modified fields from the source to the destination
document.

LC

On Sun, Jul 24, 2016 at 9:35 AM, Maruan Sahyoun <[email protected]>
wrote:

> Hi,
>
> > Am 24.07.2016 um 03:57 schrieb L. C. Light <
> [email protected]>:
> >
> > Hi!
> >
> > I'm running into the following (old?) error with PDFBox 2.0.2:
> >
> > ERROR [main][ReceiptSvc]: *Could not find font: /F3*
> > java.io.IOException: Could not find font: /F3
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.processSetFont(PDDefaultAppearanceString.java:170)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.processOperator(PDDefaultAppearanceString.java:131)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.processAppearanceStringOperators(PDDefaultAppearanceString.java:107)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.<init>(PDDefaultAppearanceString.java:85)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDVariableText.getDefaultAppearanceString(PDVariableText.java:93)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.<init>(AppearanceGeneratorHelper.java:90)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.refreshAppearances(PDAcroForm.java:324)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> > at
> >
> org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.flatten(PDAcroForm.java:213)
> > ~[pdfbox-2.0.2.jar:2.0.2]
> >
> > Basically all I'm trying to do is to flatten all of the document fields
> > with refreshAppearances = true. (The fields are set in the code before
> the
> > flatten() call, thus if refreshAppearances = false, nothing will be shown
> > in the final document.)
>
> The reason for that exception is that when PDFBox generates the appearance
> stream, the visual representation of the form field, it looks for a font
> with the COSName F3 either in the fields or the AcroForms resources entry.
> But there is no font with such name.
>
> A possible workaround is to generate that entry prior to doing the flatten
> call. If you upload the form to a public location I can take a look and
> suggest some code.
>
> BR
> Maruan
>
>
>
> >
> > The old issue (PDFBOX-1238) suggested the usage of
> NonSequentialPDFParser,
> > however (as far as I've seen) this has been already merged into the
> current
> > PDFParser.
> >
> > Could you please help?
> >
> > Thanks
> > LC
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to