ICEpdf
  1. ICEpdf
  2. PDF-177

Gradients, lines and image borders are not converted correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -

      Description

      The following PDF files are correctly converted to images. Gradients, lines, and image borders are not converted correctly. Here is a description of each issue per test PDF:

      File1.pdf
      * Entire chart is missing

      File2.pdf
      * Missing horizontal lines
      * Blue / white gradient is not placed exactly
      * Black / white gradient is too subtle

      File 3.pdf
      * Missing horizontal lines
      * Background looks very different

      File 4.pdf
      * Missing a connecting line for white dots
      * Missing red border for green dots
      * Background looks a bit different

      File 5.pdf
      * Missing horizontal lines
      * Missing border on pink (one side) and green (all sides) bars
      * Missing border (one side) on white label

        Activity

        Hide
        Patrick Corless added a comment -

        File1.pdf

        • Entire chart is missing
          The PDF specifies a linear gradient that has the same start and end point which can't be handle by the batik library. Updated the code to detect the same start end point and shift the end point slightly so we can still paint with the gradient.

        File2.pdf

        • Missing horizontal lines
        • Blue / white gradient is not placed exactly
        • Black / white gradient is too subtle
          Bug in our content parser where we where applying the fill gradient to the stroking operations. Looks more like a copy past error. The gradient colour issue was do to the fact that we only sampled for three colour points on the gradient. I changed to the mid point logic to calculate the equation of the line and thus we can calculate any number of points along gradient line. 10 sample points seems to be a nice sample size to get the correct gradient contrast as well as to be do computationally expensive to draw.

        File 3.pdf

        • Missing horizontal lines
        • Background looks very different
          Same stroking issue. Updated how we calculate the radial gradient dimension which fixes the how the background look.

        File 4.pdf

        • Missing a connecting line for white dots
        • Missing red border for green dots
        • Background looks a bit different
          Stroking issue and radial paint issue.

        File 5.pdf

        • Missing horizontal lines
        • Missing border on pink (one side) and green (all sides) bars
        • Missing border (one side) on white label
          Stroking issue.

        So all and all the PDF in question look as they should. Will check in the code and close the issue.

        Show
        Patrick Corless added a comment - File1.pdf Entire chart is missing The PDF specifies a linear gradient that has the same start and end point which can't be handle by the batik library. Updated the code to detect the same start end point and shift the end point slightly so we can still paint with the gradient. File2.pdf Missing horizontal lines Blue / white gradient is not placed exactly Black / white gradient is too subtle Bug in our content parser where we where applying the fill gradient to the stroking operations. Looks more like a copy past error. The gradient colour issue was do to the fact that we only sampled for three colour points on the gradient. I changed to the mid point logic to calculate the equation of the line and thus we can calculate any number of points along gradient line. 10 sample points seems to be a nice sample size to get the correct gradient contrast as well as to be do computationally expensive to draw. File 3.pdf Missing horizontal lines Background looks very different Same stroking issue. Updated how we calculate the radial gradient dimension which fixes the how the background look. File 4.pdf Missing a connecting line for white dots Missing red border for green dots Background looks a bit different Stroking issue and radial paint issue. File 5.pdf Missing horizontal lines Missing border on pink (one side) and green (all sides) bars Missing border (one side) on white label Stroking issue. So all and all the PDF in question look as they should. Will check in the code and close the issue.
        Hide
        Patrick Corless added a comment -

        Checked in the code and in general have improved the rendering quality of type 2 and 3 gradients.

        Show
        Patrick Corless added a comment - Checked in the code and in general have improved the rendering quality of type 2 and 3 gradients.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: