PreviewOptions

Inheritance: java.lang.Object

public class PreviewOptions

Provides options for generating document previews in the comparison process.

Example usage:


 try (Comparer comparer = new Comparer(sourceFile)) {

    PreviewOptions previewOptions = new PreviewOptions(
            pageNumber -> Files.newOutputStream(Paths.get(String.format("preview-page_%d.png", pageNumber)))
    );
    previewOptions.setPreviewFormat(PreviewFormats.PNG);
    previewOptions.setPageNumbers(new int[]{1, 2});

    comparer.getSource().generatePreview(previewOptions);
 }
 

Constructors

Constructor Description
PreviewOptions(Delegates.CreatePageStream createPageStream) Initializes a new instance of the PreviewOptions class specifying Delegates.CreatePageStream function.
PreviewOptions(CreatePageStreamFunction createPageStream) Initializes a new instance of the PreviewOptions class specifying CreatePageStreamFunction function.
PreviewOptions(Delegates.CreatePageStream createPageStream, Delegates.ReleasePageStream releasePageStream) Initializes a new instance of the PreviewOptions class specifying Delegates.CreatePageStream and Delegates.ReleasePageStream function.
PreviewOptions(CreatePageStreamFunction createPageStream, ReleasePageStreamFunction releasePageStream) Initializes a new instance of the PreviewOptions class specifying CreatePageStreamFunction and ReleasePageStreamFunction function.

Methods

Method Description
getCreatePageStream() Gets a function to create output page preview stream.
setCreatePageStream(Delegates.CreatePageStream createPageStream) Sets a function to create output page preview stream.
setCreatePageStream(CreatePageStreamFunction createPageStream) Sets a function to create output page preview stream.
getReleasePageStream() Gets a function to release output page preview stream.
setReleasePageStream(Delegates.ReleasePageStream releasePageStream) Gets a function to release output page preview stream.
setReleasePageStream(ReleasePageStreamFunction releasePageStream) Sets a function to release output page preview stream.
getWidth() Gets the width of the preview images.
setWidth(int value) Sets the width of the preview images.
getHeight() Gets the height of the preview images.
setHeight(int value) Sets the height of the preview images.
getPageNumbers() Gets an array of page numbers for which preview images will be generated.
setPageNumbers(int[] value) Sets an array of page numbers for which preview images will be generated.
getPreviewFormat() Gets a format of preview images.
setPreviewFormat(PreviewFormats value) Sets a format of preview images.

PreviewOptions(Delegates.CreatePageStream createPageStream)

public PreviewOptions(Delegates.CreatePageStream createPageStream)

Initializes a new instance of the PreviewOptions class specifying Delegates.CreatePageStream function.

Parameters:

Parameter Type Description
createPageStream CreatePageStream The function to create output page preview stream.

PreviewOptions(CreatePageStreamFunction createPageStream)

public PreviewOptions(CreatePageStreamFunction createPageStream)

Initializes a new instance of the PreviewOptions class specifying CreatePageStreamFunction function.

Parameters:

Parameter Type Description
createPageStream CreatePageStreamFunction The function to create output page preview stream.

PreviewOptions(Delegates.CreatePageStream createPageStream, Delegates.ReleasePageStream releasePageStream)

public PreviewOptions(Delegates.CreatePageStream createPageStream, Delegates.ReleasePageStream releasePageStream)

Initializes a new instance of the PreviewOptions class specifying Delegates.CreatePageStream and Delegates.ReleasePageStream function.

Parameters:

Parameter Type Description
createPageStream CreatePageStream The function to create output page preview stream.
releasePageStream ReleasePageStream The function to release output page preview stream.

PreviewOptions(CreatePageStreamFunction createPageStream, ReleasePageStreamFunction releasePageStream)

public PreviewOptions(CreatePageStreamFunction createPageStream, ReleasePageStreamFunction releasePageStream)

Initializes a new instance of the PreviewOptions class specifying CreatePageStreamFunction and ReleasePageStreamFunction function.

Parameters:

Parameter Type Description
createPageStream CreatePageStreamFunction The function to create output page preview stream.
releasePageStream ReleasePageStreamFunction The function to release output page preview stream.

getCreatePageStream()

public CreatePageStreamFunction getCreatePageStream()

Gets a function to create output page preview stream.

Returns: CreatePageStreamFunction - the function to create output page preview stream.

setCreatePageStream(Delegates.CreatePageStream createPageStream)

public void setCreatePageStream(Delegates.CreatePageStream createPageStream)

Sets a function to create output page preview stream.

Parameters:

Parameter Type Description
createPageStream CreatePageStream The function to create output page preview stream.

setCreatePageStream(CreatePageStreamFunction createPageStream)

public void setCreatePageStream(CreatePageStreamFunction createPageStream)

Sets a function to create output page preview stream.

Parameters:

Parameter Type Description
createPageStream CreatePageStreamFunction The function to create output page preview stream.

getReleasePageStream()

public ReleasePageStreamFunction getReleasePageStream()

Gets a function to release output page preview stream.

Returns: ReleasePageStreamFunction - the function to release output page preview stream.

setReleasePageStream(Delegates.ReleasePageStream releasePageStream)

public void setReleasePageStream(Delegates.ReleasePageStream releasePageStream)

Gets a function to release output page preview stream.

Parameters:

Parameter Type Description
releasePageStream ReleasePageStream The function to release output page preview stream.

setReleasePageStream(ReleasePageStreamFunction releasePageStream)

public void setReleasePageStream(ReleasePageStreamFunction releasePageStream)

Sets a function to release output page preview stream.

Parameters:

Parameter Type Description
releasePageStream ReleasePageStreamFunction The function to release output page preview stream.

getWidth()

public final int getWidth()

Gets the width of the preview images.

Returns: int - the width of the preview images.

setWidth(int value)

public final void setWidth(int value)

Sets the width of the preview images.

Parameters:

Parameter Type Description
value int The width of the preview images.

getHeight()

public final int getHeight()

Gets the height of the preview images.

Returns: int - the height of the preview images.

setHeight(int value)

public final void setHeight(int value)

Sets the height of the preview images.

Parameters:

Parameter Type Description
value int The height of the preview images.

getPageNumbers()

public final int[] getPageNumbers()

Gets an array of page numbers for which preview images will be generated.

Returns: int[] - page numbers array

setPageNumbers(int[] value)

public final void setPageNumbers(int[] value)

Sets an array of page numbers for which preview images will be generated.

Parameters:

Parameter Type Description
value int[] Page numbers array

getPreviewFormat()

public final PreviewFormats getPreviewFormat()

Gets a format of preview images.

Returns: PreviewFormats - preview images format

setPreviewFormat(PreviewFormats value)

public final void setPreviewFormat(PreviewFormats value)

Sets a format of preview images.

Parameters:

Parameter Type Description
value PreviewFormats Preview images format