public class PreviewOptions extends Object
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);
}
Comparer,
PreviewFormats| Modifier and Type | Class and Description |
|---|---|
static class |
PreviewOptions.Builder
A
PreviewOptions builder. |
| Constructor and Description |
|---|
PreviewOptions(CreatePageStreamFunction createPageStream)
Initializes a new instance of the PreviewOptions class specifying
CreatePageStreamFunction function. |
PreviewOptions(CreatePageStreamFunction createPageStream,
ReleasePageStreamFunction releasePageStream)
Initializes a new instance of the PreviewOptions class specifying
CreatePageStreamFunction and ReleasePageStreamFunction function. |
PreviewOptions(com.groupdocs.comparison.common.delegates.Delegates.CreatePageStream createPageStream)
Initializes a new instance of the PreviewOptions class specifying
Delegates.CreatePageStream function. |
PreviewOptions(com.groupdocs.comparison.common.delegates.Delegates.CreatePageStream createPageStream,
com.groupdocs.comparison.common.delegates.Delegates.ReleasePageStream releasePageStream)
Initializes a new instance of the PreviewOptions class specifying
Delegates.CreatePageStream and Delegates.ReleasePageStream function. |
| Modifier and Type | Method and Description |
|---|---|
CreatePageStreamFunction |
getCreatePageStream()
Gets a function to create output page preview stream.
|
int |
getHeight()
Gets the height of the preview images.
|
int[] |
getPageNumbers()
Gets an array of page numbers for which preview images will be generated.
|
PreviewFormats |
getPreviewFormat()
Gets a format of preview images.
|
ReleasePageStreamFunction |
getReleasePageStream()
Gets a function to release output page preview stream.
|
int |
getWidth()
Gets the width of the preview images.
|
void |
setCreatePageStream(CreatePageStreamFunction createPageStream)
Sets a function to create output page preview stream.
|
void |
setCreatePageStream(com.groupdocs.comparison.common.delegates.Delegates.CreatePageStream createPageStream)
Sets a function to create output page preview stream.
|
void |
setHeight(int value)
Sets the height of the preview images.
|
void |
setPageNumbers(int[] value)
Sets an array of page numbers for which preview images will be generated.
|
void |
setPreviewFormat(PreviewFormats value)
Sets a format of preview images.
|
void |
setReleasePageStream(com.groupdocs.comparison.common.delegates.Delegates.ReleasePageStream releasePageStream)
Gets a function to release output page preview stream.
|
void |
setReleasePageStream(ReleasePageStreamFunction releasePageStream)
Sets a function to release output page preview stream.
|
void |
setWidth(int value)
Sets the width of the preview images.
|
public PreviewOptions(CreatePageStreamFunction createPageStream)
Initializes a new instance of the PreviewOptions class specifying CreatePageStreamFunction function.
createPageStream - The function to create output page preview stream.public PreviewOptions(CreatePageStreamFunction createPageStream, ReleasePageStreamFunction releasePageStream)
Initializes a new instance of the PreviewOptions class specifying CreatePageStreamFunction and ReleasePageStreamFunction function.
createPageStream - The function to create output page preview stream.releasePageStream - The function to release output page preview stream.public PreviewOptions(com.groupdocs.comparison.common.delegates.Delegates.CreatePageStream createPageStream)
Initializes a new instance of the PreviewOptions class specifying Delegates.CreatePageStream function.
createPageStream - The function to create output page preview stream.public PreviewOptions(com.groupdocs.comparison.common.delegates.Delegates.CreatePageStream createPageStream,
com.groupdocs.comparison.common.delegates.Delegates.ReleasePageStream releasePageStream)
Initializes a new instance of the PreviewOptions class specifying Delegates.CreatePageStream and Delegates.ReleasePageStream function.
createPageStream - The function to create output page preview stream.releasePageStream - The function to release output page preview stream.public CreatePageStreamFunction getCreatePageStream()
Gets a function to create output page preview stream.
public final int getHeight()
Gets the height of the preview images.
public final int[] getPageNumbers()
Gets an array of page numbers for which preview images will be generated.
public final PreviewFormats getPreviewFormat()
Gets a format of preview images.
public ReleasePageStreamFunction getReleasePageStream()
Gets a function to release output page preview stream.
public final int getWidth()
Gets the width of the preview images.
public void setCreatePageStream(CreatePageStreamFunction createPageStream)
Sets a function to create output page preview stream.
createPageStream - The function to create output page preview stream.public void setCreatePageStream(com.groupdocs.comparison.common.delegates.Delegates.CreatePageStream createPageStream)
Sets a function to create output page preview stream.
createPageStream - The function to create output page preview stream.public final void setHeight(int value)
Sets the height of the preview images.
value - The height of the preview images.public final void setPageNumbers(int[] value)
Sets an array of page numbers for which preview images will be generated.
value - Page numbers arraypublic final void setPreviewFormat(PreviewFormats value)
Sets a format of preview images.
value - Preview images formatpublic void setReleasePageStream(com.groupdocs.comparison.common.delegates.Delegates.ReleasePageStream releasePageStream)
Gets a function to release output page preview stream.
releasePageStream - The function to release output page preview stream.public void setReleasePageStream(ReleasePageStreamFunction releasePageStream)
Sets a function to release output page preview stream.
releasePageStream - The function to release output page preview stream.public final void setWidth(int value)
Sets the width of the preview images.
value - The width of the preview images.Copyright © 2024. All rights reserved.