PreviewFormats
Leave feedback
On this page
Inheritance: java.lang.Object, java.lang.Enum
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.PNG - Portable Network Graphics (.png)
- #JPEG.JPEG - Joint Photographic Experts Group (.jpeg)
- #BMP.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);
}
| Field | Description |
|---|---|
| PNG | PNG - may consume significant disk space or network traffic if the page contains numerous color graphics. |
| JPEG | Jpeg - provides faster processing with smaller disk space usage and network traffic, but may result in lower image quality. |
| BMP | BMP - offers the best image quality but requires slower processing with higher disk space usage and network traffic. |
| Method | Description |
|---|---|
| values() | |
| valueOf(String name) | |
| fromString(String toStringValue) | Parses string representation of PreviewFormats to get the enum constant. |
| toString() | String representation of PreviewFormats. |
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 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 BMP
BMP - offers the best image quality but requires slower processing with higher disk space usage and network traffic.
public static PreviewFormats[] values()
Returns: com.groupdocs.comparison.options.enums.PreviewFormats[]
public static PreviewFormats valueOf(String name)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String |
Returns: PreviewFormats
public static PreviewFormats fromString(String toStringValue)
Parses string representation of PreviewFormats to get the enum constant.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| toStringValue | java.lang.String | The string representation of PreviewFormats |
Returns: PreviewFormats - PreviewFormats enum constant associated with input string
public String toString()
String representation of PreviewFormats.
Returns: java.lang.String - string value of enum constant
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.