pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: Could not find font: /F3 (pdfbox 2.0.2)
Date Mon, 25 Jul 2016 08:52:13 GMT
Hi,

> Am 25.07.2016 um 01:09 schrieb L. C. Light <golden.crystal.lightning@gmail.com>:
> 
> Yeah, it is quite obvious from the stacktrace that "F3" is a font name, but
> where does this name come from?

the name is part of the default appearance string which defines, apart form possible other
setting, the font and the font size to use for formatting the field value.

> 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.
> 

which version of PDFBox are you using? Could you provide a short sample code to replicate
the issue?

BR
Maruan


> LC
> 
> On Sun, Jul 24, 2016 at 9:35 AM, Maruan Sahyoun <sahyoun@fileaffairs.de>
> wrote:
> 
>> Hi,
>> 
>>> Am 24.07.2016 um 03:57 schrieb L. C. Light <
>> golden.crystal.lightning@gmail.com>:
>>> 
>>> 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: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message