Class ExportPresenter

java.lang.Object
com.inet.pdfc.presenter.BasePresenter
com.inet.pdfc.presenter.ExportPresenter
All Implemented Interfaces:
com.inet.plugin.NamedExtension, Cloneable
Direct Known Subclasses:
DifferencesPrintPresenter, ExportFilePresenter

public abstract class ExportPresenter extends BasePresenter implements Cloneable
Basic presenter for Exports which generates a graphical comparison result.
Contains some useful methods allowing some settings to be made and applied to the PrintPainter.
  • Field Details

    • PAINT_LEFT

      public static final byte PAINT_LEFT
      Toggle between Left/Right/Both Left mean the first document
      See Also:
    • PAINT_RIGHT

      public static final byte PAINT_RIGHT
      Toggle between Left/Right/Both Right mean the second document
      See Also:
    • PAINT_BOTH

      public static final byte PAINT_BOTH
      Toggle between Left/Right/Both Both document will be presented
      See Also:
  • Constructor Details

    • ExportPresenter

      public ExportPresenter()
  • Method Details

    • createAndSetupPrintPainter

      protected com.inet.pdfc.print.PrintPainter createAndSetupPrintPainter()
      Constructs a new PrintPainter which can be used to export the result.
      This method also sets options on the PrintPainter.

      This method is called once for each pair of PDFs for that a graphical result is exported for.

      Returns:
      the new constructed PrintPainter.
      Since:
      i-net PDFC 3.0
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
      Set the background color of the print. This color is used for the areas where to page is, between the pages. Set to null to skip painting a background.

      default is White for PDF and null for PNG or Print.

      Parameters:
      backgroundColor - the background color of the PrintPainter
      Since:
      i-net PDFC 3.0
    • setPaintSides

      public void setPaintSides(byte sides)
      Set weather the first or the second of both compared documents must be painted.

      Default is PAINT_BOTH

      This option has no effect if setPaintOverlap(boolean) is set to true.

      Parameters:
      sides - document sides to paint, can be PAINT_LEFT, PAINT_RIGHT or PAINT_BOTH
      Since:
      i-net PDFC 3.0
    • setPaintOverlap

      public void setPaintOverlap(boolean paintOverlap)
      Set to true if the compared documents must be exported in overlapping mode.

      Default is false.

      If this is true, the option setPaintSides(byte) has no effect.

      Parameters:
      paintOverlap - the paintOverlap of the PrintPainter
      Since:
      i-net PDFC 3.0
    • setOverlapAlpha

      public void setOverlapAlpha(float overlapAlpha)
      Set the alpha to use for overlapping export. Has only an effect if setPaintOverlap(boolean) is true. Must be between 0.0 and 1.0, where 0 means the right document completely overwrites the left document and 1 means the left document overwrites the right document.

      Default is 0.5.

      Parameters:
      overlapAlpha - the overlapAlpha of the PrintPainter
      Throws:
      IllegalArgumentException - if overlapAlpha is invalid
      Since:
      i-net PDFC 3.0