public enum Position extends Enum<Position>
The Position enum represents different positions for a watermark in the GroupDocs.Viewer component. It provides a set of predefined positions that can be used to specify the placement of a watermark on a document or image during the rendering process.
Example usage:
Watermark watermark = new Watermark("Watermark");
watermark.setPosition(Position.DIAGONAL);
watermark.setColor(java.awt.Color.GREEN);
watermark.setSize(Size.HALF_SIZE);
PdfViewOptions pdfViewOptions = new PdfViewOptions();
pdfViewOptions.setWatermark(watermark);
try (Viewer viewer = new Viewer("document.docx")) {
viewer.view(pdfViewOptions);
// Use the viewer object for further operations
}
Viewer,
Watermark,
PdfViewOptions| Enum Constant and Description |
|---|
BOTTOM_CENTER
The bottom center position.
|
BOTTOM_LEFT
The bottom left position.
|
BOTTOM_RIGHT
The bottom right position.
|
DIAGONAL
The diagonal position.
|
TOP_CENTER
The top center position.
|
TOP_LEFT
The top left position.
|
TOP_RIGHT
The top right position.
|
| Modifier and Type | Method and Description |
|---|---|
static Position |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Position[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Position BOTTOM_CENTER
The bottom center position. This position represents the bottom center alignment or placement.
public static final Position BOTTOM_LEFT
The bottom left position. This position represents the bottom left corner alignment or placement.
public static final Position BOTTOM_RIGHT
The bottom right position. This position represents the bottom right corner alignment or placement.
public static final Position DIAGONAL
The diagonal position. This position represents a diagonal alignment or placement.
public static final Position TOP_CENTER
The top center position. This position represents the top center alignment or placement.
public static final Position TOP_LEFT
The top left position. This position represents the top left corner alignment or placement.
public static final Position TOP_RIGHT
The top right position. This position represents the top right corner alignment or placement.
public static Position 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 Position[] values()
for (Position c : Position.values()) System.out.println(c);
Copyright © 2024. All rights reserved.