ICEpdf
  1. ICEpdf
  2. PDF-92

Type 3 font print scalling issue

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.4, 5.0.0 alpha1, 5.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows
    • Assignee Priority:
      P3
    • Workaround Description:
      By disabling the system property -Dorg.icepdf.core.text.optimized=false in version 4.1 the printed output is improved. This isn't optimal but clipping optimizations shouldn't make this super slow.

      Description

      This pdf can be rendered on screen, but if you try to print it all charactersare are wild miscellaneous.

      The licensed version. v2.7.1 is affected but also the 3.1 open source version and the commercial version with the font engine are affected.
      1. 340493_anonymisiert.pdf
        44 kB
        Fabian Epp
      2. print_v4_1_4_text_optim_false-1.pdf
        164 kB
        Tyler Johnson
      3. print_v4_2_0_text_optim_false.pdf
        156 kB
        Tyler Johnson

        Activity

        Fabian Epp created issue -
        Fabian Epp made changes -
        Field Original Value New Value
        Attachment 340493_anonymisiert.pdf [ 12121 ]
        Patrick Corless made changes -
        Salesforce Case []
        Fix Version/s 4.0 [ 10222 ]
        Hide
        Patrick Corless added a comment -

        Likely a resource loading issue like PDF-129.

        Show
        Patrick Corless added a comment - Likely a resource loading issue like PDF-129 .
        Hide
        Patrick Corless added a comment -

        It appears that this issue effect all type 3 fonts. The print banding doesn't seem to do well with the small glyph images generated by the type3 fonts. The fonts are present but have been shrunk significantly. I tried turning off image scaling but that didn't seem to change anything.

        I'll have to revisit this issue later as it is likely a Java Print issue.

        Show
        Patrick Corless added a comment - It appears that this issue effect all type 3 fonts. The print banding doesn't seem to do well with the small glyph images generated by the type3 fonts. The fonts are present but have been shrunk significantly. I tried turning off image scaling but that didn't seem to change anything. I'll have to revisit this issue later as it is likely a Java Print issue.
        Patrick Corless made changes -
        Summary PDF cannot be printed. All characters are wild miscellaneous Type 3 font print scalling issue
        Salesforce Case []
        Fix Version/s 4.1 [ 10227 ]
        Fix Version/s 4.0 [ 10222 ]
        Hide
        Patrick Corless added a comment -

        After fixing a tranform bug with xform objects intersection with the clip this issue seems to reproduceable with the default ri viewer. Likely a similar spacial but is present in the type3 glyph content paths.

        Show
        Patrick Corless added a comment - After fixing a tranform bug with xform objects intersection with the clip this issue seems to reproduceable with the default ri viewer. Likely a similar spacial but is present in the type3 glyph content paths.
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 4.0.2 [ 10234 ]
        Fix Version/s 4.1 [ 10227 ]
        Patrick Corless made changes -
        Fix Version/s 4.1 [ 10227 ]
        Fix Version/s 4.0.2 [ 10234 ]
        Hide
        Patrick Corless added a comment -

        It appears this is a bounding issue for the type three fonts used in the filed. For some reason when I paint the bounds they aren't even close to the glyphs that are painted. During printing the clip is usually pretty tight which would explain why almost no glyphs show up when printing. I'll have to debug this further to see what up with the bounds.

        Show
        Patrick Corless added a comment - It appears this is a bounding issue for the type three fonts used in the filed. For some reason when I paint the bounds they aren't even close to the glyphs that are painted. During printing the clip is usually pretty tight which would explain why almost no glyphs show up when printing. I'll have to debug this further to see what up with the bounds.
        Hide
        Patrick Corless added a comment -

        Really having a hard time with this one, can't seem to find the cause and beginning to think it might be malformed. The max bounds of the fonts are not correctly assigned which leads to some glyphs being trimmed by the print banding clips. However each glyph has a clip defined that seems to be responsible for just about every glyph to be cut during the print.

        Show
        Patrick Corless added a comment - Really having a hard time with this one, can't seem to find the cause and beginning to think it might be malformed. The max bounds of the fonts are not correctly assigned which leads to some glyphs being trimmed by the print banding clips. However each glyph has a clip defined that seems to be responsible for just about every glyph to be cut during the print.
        Hide
        Fabian Epp added a comment -

        If it would be malformed I couldn´t understand why the pdf displays correct on screen....

        Show
        Fabian Epp added a comment - If it would be malformed I couldn´t understand why the pdf displays correct on screen....
        Patrick Corless made changes -
        Workaround Description By enabling the system property -Dorg.icepdf.core.paint.disableClipping=true in version 4.1 the printed output is improved. Still not perfect but this will help a bit when trying to figure out what is wrong with the MS print driver and small clips.
        Salesforce Case []
        Patrick Corless made changes -
        Salesforce Case []
        Fix Version/s 4.1.1 [ 10244 ]
        Fix Version/s 4.1 [ 10227 ]
        Hide
        Patrick Corless added a comment -

        I've take a a really close look at this issue and it is related to how the PDF in question is encoded. The font bbox is [0,0, 1000, 1000] which appears to be incorrect when compared to the font's widths that average at 20 units.

        When we do layout we depend on the Postscript as well as the font's glyph width. We use the bbox to optimize the drawing of the font glyph, if the font's bbox isn't in the current clip then we don't bother drawing it. In the viewer RI this work out OK as the view window clips is usually quite large, the size of the viewer itself and the incorrect bbox always intersects the view and thus we draw it. However when a PDF of this type is printed the print clip is quite small around 5x5 units. The print clip doesn't always intersect with the incorrectly aligned bbox and thus we don't draw the glyph.

        This is the only sample that has an incorrectly encoded bbox, my other samples all draw the bbox correctly and seem to print without missing content. I incorrectly described the workaround for this issue. Make sure to enable clipping but make sure you set -Dorg.icepdf.core.text.optimized=false to disabled ICEpdf's text clip optimization.

        Show
        Patrick Corless added a comment - I've take a a really close look at this issue and it is related to how the PDF in question is encoded. The font bbox is [0,0, 1000, 1000] which appears to be incorrect when compared to the font's widths that average at 20 units. When we do layout we depend on the Postscript as well as the font's glyph width. We use the bbox to optimize the drawing of the font glyph, if the font's bbox isn't in the current clip then we don't bother drawing it. In the viewer RI this work out OK as the view window clips is usually quite large, the size of the viewer itself and the incorrect bbox always intersects the view and thus we draw it. However when a PDF of this type is printed the print clip is quite small around 5x5 units. The print clip doesn't always intersect with the incorrectly aligned bbox and thus we don't draw the glyph. This is the only sample that has an incorrectly encoded bbox, my other samples all draw the bbox correctly and seem to print without missing content. I incorrectly described the workaround for this issue. Make sure to enable clipping but make sure you set -Dorg.icepdf.core.text.optimized=false to disabled ICEpdf's text clip optimization.
        Patrick Corless made changes -
        Workaround Description By enabling the system property -Dorg.icepdf.core.paint.disableClipping=true in version 4.1 the printed output is improved. Still not perfect but this will help a bit when trying to figure out what is wrong with the MS print driver and small clips. By disabling the system property -Dorg.icepdf.core.text.optimized=false in version 4.1 the printed output is improved. This isn't optimal but clipping optimizations shouldn't make this super slow.
        Salesforce Case []
        Fix Version/s 4.2 [ 10243 ]
        Fix Version/s 4.1.1 [ 10244 ]
        Patrick Corless made changes -
        Salesforce Case []
        Assignee Priority P3
        Hide
        Patrick Corless added a comment -

        Unfortuantely no new news on this one.

        Show
        Patrick Corless added a comment - Unfortuantely no new news on this one.
        Patrick Corless made changes -
        Salesforce Case []
        Fix Version/s 4.2 [ 10243 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000ArdES]
        Hide
        Tyler Johnson added a comment -

        A customer has reported that the workaround of setting -Dorg.icepdf.core.text.optimized=false no longer works in 4.2. The text appears correctly in 4.1.4 but is garbled is 4.2. I cannot reproduce this issue on my Mac OSX 10.6.7 with Java 1.6.0_24 in either 4.1.4 or 4.2 or with Windows 7 and JDK 1.6.0_23. Is this a possible regression in certain environments?

        Show
        Tyler Johnson added a comment - A customer has reported that the workaround of setting -Dorg.icepdf.core.text.optimized=false no longer works in 4.2. The text appears correctly in 4.1.4 but is garbled is 4.2. I cannot reproduce this issue on my Mac OSX 10.6.7 with Java 1.6.0_24 in either 4.1.4 or 4.2 or with Windows 7 and JDK 1.6.0_23. Is this a possible regression in certain environments?
        Tyler Johnson made changes -
        Hide
        Patrick Corless added a comment -

        There where no changes made to 4.2 around the property -Dorg.icepdf.core.text.optimized=false. The issue they are seeing is related to how widths are calculated for glyphs. I'll have to take a closer look to see if this is related to how the sz token is handled. .

        Show
        Patrick Corless added a comment - There where no changes made to 4.2 around the property -Dorg.icepdf.core.text.optimized=false. The issue they are seeing is related to how widths are calculated for glyphs. I'll have to take a closer look to see if this is related to how the sz token is handled. .
        Hide
        Patrick Corless added a comment -

        Update the NFontType3 bbox logic to property scale and convert the box to correct space for painting. Text selection is now as predictable as acrobat.

        Show
        Patrick Corless added a comment - Update the NFontType3 bbox logic to property scale and convert the box to correct space for painting. Text selection is now as predictable as acrobat.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0 [ 10314 ]
        Resolution Fixed [ 1 ]
        Patrick Corless made changes -
        Fix Version/s 5.0.0 alpha1 [ 10676 ]
        Patrick Corless made changes -
        Fix Version/s 4.4 [ 10670 ]
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Fabian Epp
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: