[ 
https://issues.apache.org/jira/browse/PDFBOX-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13896171#comment-13896171
 ] 

Pat Hickey commented on PDFBOX-1895:
------------------------------------

I am very sorry not to have permission (yet) to share the document. I'm working 
on that.
I'll just illustrate one of the items that don't seem to be working.
The input document is looking for font F0 as object number 7.
It has the FontDescriptor as object number 5, 
which is before it is used in the Font defined in object number 6, 
which is then used as the DescendantFonts in object number 7, where font F0 is 
expected.
This is the pattern of the input document: the font descriptors precede the 
references to them.
Adobe Reader is able to find and display these fonts.
The output document is looking for font F0 as object number 145.
Object number 145 references the DescendantFonts in object number 375.
Object number 375 references the FontDescriptor in object number 405.
This is the pattern of the output document: the font descriptors follow the 
references to them.
Adobe Reader is *not* able to find or display these fonts.
Again, the operation here is, basically, just load and save.

h4. INPUT DOCUMENT (just the good parts):
3 0 obj
<<
/Font <<
/F0 7 0 R
/F1 10 0 R
/G1 277 0 R
>>
5 0 obj
<<
/Ascent 859
/CapHeight 669
/Descent -140
/Flags 7
/FontBBox
\[-82 -136 996 859\]

/FontName /MS-Mincho
/ItalicAngle 0
/StemV 92
/Style <<
/Panose <F0D23A222D4936AB277A3345>
>>
/Type /FontDescriptor
/XHeight 439
>>
endobj
6 0 obj
<<
/BaseFont /MS-Mincho
/CIDSystemInfo <<
/CIDToGIDMap /Identity
/Ordering <15E1735673F3>
/Registry <1EE46C5578>
/Supplement 4
>>
/DW 1000
/FontDescriptor 5 0 R
/Subtype /CIDFontType2
/Type /Font
/W \[ WIDTHS REMOVED FOR BREVITY \]
>>
endobj
7 0 obj
<<
/BaseFont /MS-Mincho
/DescendantFonts
\[6 0 R\]

/Encoding /UniJIS-UCS2-H
/Subtype /Type0
/Type /Font
>>
endobj

h4. OUTPUT DOCUMENT (just the good parts):

54 0 obj
<<
/Font <<
/F0 145 0 R
/F1 146 0 R
/G1 147 0 R
>>
145 0 obj
<<
/BaseFont /MS-Mincho
/DescendantFonts
\[375 0 R\]

/Encoding /UniJIS-UCS2-H
/Subtype /Type0
/Type /Font
>>
endobj
375 0 obj
<<
/BaseFont /MS-Mincho
/CIDSystemInfo <<
/CIDToGIDMap /Identity
/Ordering <15E1735673F3>
/Registry <1EE46C5578>
/Supplement 4
>>
/DW 1000
/FontDescriptor 405 0 R
/Subtype /CIDFontType2
/Type /Font
/W \[ WIDTHS DELETED FOR BREVITY \]
>>
endobj

> Font definitions must precede font references
> ---------------------------------------------
>
>                 Key: PDFBOX-1895
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1895
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 1.8.3, 1.8.4
>            Reporter: Pat Hickey
>
> When re-writing a document with font descriptions, Adobe Reader is unable to 
> display the fonts in the document.  Reader can display the fonts in the 
> original document. The difference is that in the original document, the font 
> descriptions are in lower object numbers than the font references; in the 
> output document, the font descriptions are in higher object numbers than the 
> font references.  Is there a quick way to re-order them?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to