Class ResultPage

  • All Implemented Interfaces:
    java.io.Serializable

    @JsonData
    public class ResultPage
    extends java.lang.Object
    implements java.io.Serializable
    A page result contains all information for a page in a compares document. Since the actual comparison result is not bound to pages, the result itself is not part of a ResultPage.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ResultPage()
      Create uninitialized page
      protected ResultPage​(com.inet.pdfc.generator.message.PageData data, com.inet.pdfc.generator.rendercache.PageImageCache renderSource, ResultModel model)
      Creates a page for the ResultModel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getHeight()
      Returns the unscaled height of the page in pixel
      java.util.List<HighlightData.Highlight> getHighlights()
      Returns a list with all highlights for this page
      java.awt.image.BufferedImage getPageImage​(double scale)
      Renders the page to a BufferedImage.
      java.awt.image.BufferedImage getPageImage​(double scaleX, double scaleY)
      Renders the page to a BufferedImage.
      int getPageIndex()
      Returns the zero based page index of this page
      int getPageOffset()
      Returns the page offset which is the absolute rendering position in side by side mode.
      java.awt.Dimension getSize()
      Returns the size of the page in pixels, unscaled
      protected java.util.List<TextInfo> getTextInfos()
      Returns the text infos required to select and copy text
      int getWidth()
      Returns the unscaled width of the page in pixel
      boolean hasPageImage()
      Returns whether the page image cache contains an image for this page
      boolean isLeft()
      Check whether this page is on the left side or on the right side.
      void renderPage​(double scale, java.awt.Graphics2D g2)
      Renders the page to a BufferedImage.
      protected void setData​(com.inet.pdfc.generator.message.PageData data)
      Copies the page data into the ResultPage
      void setModel​(ResultModel model)
      Sets the model as well as the renderSource of this page
      protected void setPageOffset​(int yOffset)
      Updates the page offset.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResultPage

        protected ResultPage​(com.inet.pdfc.generator.message.PageData data,
                             com.inet.pdfc.generator.rendercache.PageImageCache renderSource,
                             ResultModel model)
        Creates a page for the ResultModel
        Parameters:
        data - the page data as passed by the comparer, must not be null
        renderSource - the render source to query for page images, must not be null
        model - the actual comparison model this page belongs to
        Since:
        i-net PDFC 3.0
      • ResultPage

        protected ResultPage()
        Create uninitialized page
        Since:
        i-net PDFC 3.0
    • Method Detail

      • setData

        protected void setData​(com.inet.pdfc.generator.message.PageData data)
        Copies the page data into the ResultPage
        Parameters:
        data - the data to be copied, must not be null
        Since:
        i-net PDFC 3.0
      • getWidth

        public int getWidth()
        Returns the unscaled width of the page in pixel
        Returns:
        the unscaled width of the page in pixel
        Since:
        i-net PDFC 3.0
      • getHeight

        public int getHeight()
        Returns the unscaled height of the page in pixel
        Returns:
        the unscaled height of the page in pixel
        Since:
        i-net PDFC 3.0
      • getPageOffset

        public int getPageOffset()
        Returns the page offset which is the absolute rendering position in side by side mode. It's the sum of the max-height of all page-pairs before this one
        Returns:
        the page offset which is the absolute rendering position in side by side mode
        Since:
        i-net PDFC 3.0
      • setPageOffset

        protected void setPageOffset​(int yOffset)
        Updates the page offset. The page offset is the total distance from the top of the page to the start of the document in pixels (without page gaps).
        Parameters:
        yOffset - the page offset of the page in pixels
        Since:
        i-net PDFC 3.0
        See Also:
        getPageOffset()
      • getPageIndex

        public int getPageIndex()
        Returns the zero based page index of this page
        Returns:
        the zero based page index of this page
        Since:
        i-net PDFC 3.0
      • getHighlights

        public java.util.List<HighlightData.Highlight> getHighlights()
        Returns a list with all highlights for this page
        Returns:
        a list with all highlights for this page or null if there are no highlights
        Since:
        i-net PDFC 3.0
      • getPageImage

        @Nullable
        public java.awt.image.BufferedImage getPageImage​(double scale)
        Renders the page to a BufferedImage.
        Parameters:
        scale - the scale factor
        Returns:
        the rendered page as image or null if not found
        Since:
        i-net PDFC 3.0
      • getPageImage

        @Nullable
        public java.awt.image.BufferedImage getPageImage​(double scaleX,
                                                         double scaleY)
        Renders the page to a BufferedImage. This mehtod allowes a change in the aspect ratio of the returned image
        Parameters:
        scaleX - the scale factor along the X axis
        scaleY - the scale factor along the Y axis
        Returns:
        the rendered page as image or null if not found
        Since:
        i-net PDFC 3.2
      • renderPage

        public void renderPage​(double scale,
                               java.awt.Graphics2D g2)
        Renders the page to a BufferedImage.
        Parameters:
        scale - the scale factor
        g2 - the graphics instance which will be used for rendering
        Since:
        i-net PDFC 3.0
      • getSize

        public java.awt.Dimension getSize()
        Returns the size of the page in pixels, unscaled
        Returns:
        the size of the page in pixels, unscaled
        Since:
        i-net PDFC 3.0
      • hasPageImage

        public boolean hasPageImage()
        Returns whether the page image cache contains an image for this page
        Returns:
        whether the page image cache contains an image for this page
        Since:
        i-net PDFC 3.0
      • getTextInfos

        protected java.util.List<TextInfo> getTextInfos()
        Returns the text infos required to select and copy text
        Returns:
        the text infos required to select and copy text
        Since:
        4.0
      • isLeft

        public boolean isLeft()
        Check whether this page is on the left side or on the right side.
        Returns:
        true if this page is on the left (first) side, false if it is on the right (second) side
        Since:
        i-net PDFC 3.2
      • setModel

        public void setModel​(ResultModel model)
        Sets the model as well as the renderSource of this page
        Parameters:
        model - the model to set
        Since:
        i-net PDFC 4.0