public enum PreviewFormats extends Enum<PreviewFormats>
Enumerates the supported preview formats for document comparison.
The PreviewFormats enum provides a list of formats that can be used to generate previews of compared documents.Supported formats include:
PNG - Portable Network Graphics (.png)JPEG - Joint Photographic Experts Group (.jpeg)BMP - Bitmap Picture (.bmp)Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
PreviewOptions previewOptions = new PreviewOptions(
pageNumber -> Files.newOutputStream(Paths.get(String.format("preview-page_%d.png", pageNumber)))
);
previewOptions.setPreviewFormat(PreviewFormats.PNG);
comparer.getTargets().get(0).generatePreview(previewOptions);
}
Comparer,
PreviewOptions| Enum Constant and Description |
|---|
BMP
BMP - offers the best image quality but requires slower processing with higher disk space usage and network traffic.
|
JPEG
Jpeg - provides faster processing with smaller disk space usage and network traffic, but may result in lower image quality.
|
PNG
PNG - may consume significant disk space or network traffic if the page contains numerous color graphics.
|
| Modifier and Type | Method and Description |
|---|---|
static PreviewFormats |
fromString(String toStringValue)
Parses string representation of PreviewFormats to get the enum constant.
|
String |
toString()
String representation of PreviewFormats.
|
static PreviewFormats |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PreviewFormats[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PreviewFormats BMP
BMP - offers the best image quality but requires slower processing with higher disk space usage and network traffic.
public static final PreviewFormats JPEG
Jpeg - provides faster processing with smaller disk space usage and network traffic, but may result in lower image quality.
public static final PreviewFormats PNG
PNG - may consume significant disk space or network traffic if the page contains numerous color graphics. Default preview format.
public static PreviewFormats fromString(String toStringValue)
Parses string representation of PreviewFormats to get the enum constant.
toStringValue - The string representation of PreviewFormatsIllegalArgumentException - if string is not one of PreviewFormats valuespublic String toString()
String representation of PreviewFormats.
toString in class Enum<PreviewFormats>public static PreviewFormats valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static PreviewFormats[] values()
for (PreviewFormats c : PreviewFormats.values()) System.out.println(c);
Copyright © 2024. All rights reserved.