ICEpdf
  1. ICEpdf
  2. PDF-639

Edited annotation contents streams can not be restored after garbage collection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.3
    • Fix Version/s: 5.0.4
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      Imagine a PDF with one annotations on the first page. A user edits this annotation in some way and goes on to other pages. When the user returns to the first page the annotation is no longer visible, only the bounding box can be scene.

        

        Activity

        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Patrick Corless made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Patrick Corless added a comment -

        Issue has been fixed on trunk and 5.0.1 branch.

        Show
        Patrick Corless added a comment - Issue has been fixed on trunk and 5.0.1 branch.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #37471 Wed Aug 21 12:57:37 MDT 2013 patrick.corless PDF-639 updated how we re-get stream data, we no make sure we don't try and uncompress a byte stream that is already uncompressed.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #37385 Tue Aug 13 13:22:55 MDT 2013 patrick.corless PDF-639 updated how we re-get stream data, we no make sure we don't try and uncompress a byte stream that is already uncompressed.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/viewer/src/org/icepdf/ri/common/views/annotations/AbstractAnnotationComponent.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/viewer/src/org/icepdf/ri/common/views/PageViewComponentImpl.java
        Hide
        Patrick Corless added a comment -

        Took a bit of time to figure out what was going on here but I've got a handle on it now. When the annotation is edited the Form object that hold the appearance content stream is created and put in the Statemanager. The Form object's raw data is set at this point, normally this stream is saved to disk on save and is compressed using zip compression.

        But in the user case above the annotation is garbage collected and when the first page is reloaded the annotation in question's appearance stream Form object is reinitialized. The problem here is that the underlying stream Object assumes the raw data is compressed where in fact it is not. The content parser then returns -1 on the first read and no shapes are parsed thus no shapes are painted.

        The stream class already has a isCompressed flag which can be used during the decode process to determine if the stream needs to be uncompressed or not. So in the usage case above we won't try to uncompress a data stream that is already uncompressed and thus the shapes no get parsed.

        Show
        Patrick Corless added a comment - Took a bit of time to figure out what was going on here but I've got a handle on it now. When the annotation is edited the Form object that hold the appearance content stream is created and put in the Statemanager. The Form object's raw data is set at this point, normally this stream is saved to disk on save and is compressed using zip compression. But in the user case above the annotation is garbage collected and when the first page is reloaded the annotation in question's appearance stream Form object is reinitialized. The problem here is that the underlying stream Object assumes the raw data is compressed where in fact it is not. The content parser then returns -1 on the first read and no shapes are parsed thus no shapes are painted. The stream class already has a isCompressed flag which can be used during the decode process to determine if the stream needs to be uncompressed or not. So in the usage case above we won't try to uncompress a data stream that is already uncompressed and thus the shapes no get parsed.
        Patrick Corless created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved: