PreviewOptions
Leave feedback
On this page
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);
}
| 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. |
| 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. |
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. |
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. |
public CreatePageStreamFunction getCreatePageStream()
Gets a function to create output page preview stream.
Returns: CreatePageStreamFunction - the function to create output page preview stream.
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. |
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. |
public ReleasePageStreamFunction getReleasePageStream()
Gets a function to release output page preview stream.
Returns: ReleasePageStreamFunction - the function to release output page preview stream.
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. |
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. |
public final int getWidth()
Gets the width of the preview images.
Returns: int - the width of the preview images.
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. |
public final int getHeight()
Gets the height of the preview images.
Returns: int - the height of the preview images.
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. |
public final int[] getPageNumbers()
Gets an array of page numbers for which preview images will be generated.
Returns: int[] - page numbers array
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 |
public final PreviewFormats getPreviewFormat()
Gets a format of preview images.
Returns: PreviewFormats - preview images format
public final void setPreviewFormat(PreviewFormats value)
Sets a format of preview images.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | PreviewFormats | Preview images format |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.