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

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: