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]

