Class ResultPage

java.lang.Object
com.inet.pdfc.results.ResultPage
All Implemented Interfaces:
Serializable

@JsonData public class ResultPage extends Object implements 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:
  • Constructor Details

    • 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 Details

    • 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:
    • 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 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 @Nullable 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 @Nullable 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, 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 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 List<? extends 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