xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexios Giotis <alex.gio...@gmail.com>
Subject Adding or not a referenced font in the PDF document's font resources
Date Mon, 12 Sep 2011 21:28:06 GMT
Hi, 

I recently had a tricky problem with some PDF files created by FOP 1.0 that could be viewed
but not printed on big production printers. It turned out that the problem was a missing font
from the resource list. Specifically, the internal font name "F1" was not listed to be the
base font Helvetica. The Adobe Acrobat preflight clearly showed the message:  Missing font
"F1" and in the PDF there were entries like:

BT
/F1 0 Tf
1 0 0 -1 0 0 Tm ET
...


but no

<<
/Font <<
  /F1 547 0 R
  /F24 551 0 R
....

The cause was my SAX filter that dynamically changes the FOP intermediate format from
<font family="sans-serif" style="normal" weight="400" variant="normal" color="#000000"/>
<text x="0" y="0">Some text to be replaced</text>
to

<font family="sans-serif" style="normal" weight="400" variant="normal" color="#000000"/>
<text x="0" y="0"></text>


I did not search for any other way to reproduce this case, but by looking in the method:
org.apache.fop.pdf.PDFResources.addFonts(PDFDocument, FontInfo)

it seems to me (not a PDF expert !) that the line with the if statement below should be deleted.
if (font.hadMappingOperations()) 

By deleting, it means that if a font is referenced, it should be added to the document's font
resources, even if there were no mapping operations (some text really written). Otherwise,
there can be cases where the PDF can't be printed.

What do you say ?

If you agree, will you fix it ? Should I submit a small patch ?


Greetings,
Alexios Giotis



Mime
View raw message