public class Watermark
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Watermark.ScaleModeValue
Indicates the method of scaling the watermark image.
|
Constructor and Description |
---|
Watermark()
Create a disabled
Watermark object. |
Watermark(java.io.File file, int opacity)
Create a
Watermark object using the specified image file and opacity. |
Watermark(java.io.File file, int opacity, int verticalOffset, int horizontalOffset)
Create a
Watermark object using the specified image file, opacity, and offsets. |
Modifier and Type | Method and Description |
---|---|
int |
getHorzOffset()
Obtains the horizontal distance, in twips, to move the watermark from the center.
|
java.io.File |
getImageFile()
Obtains the
File object describing the watermark image. |
int |
getOpacity()
Obtains the opacity of the watermark as a value between 0 and 255, inclusive.
|
int |
getPercent()
Obtains the scaling value of the watermark image as a percentage of the image's original size.
|
int |
getVertOffset()
Obtains the vertical distance, in twips, to move the watermark from the center.
|
void |
setHorzOffset(int offset)
Specifies the horizontal distance, in twips, to move the watermark from the center.
|
void |
setImageFile(java.io.File file)
Specifies the
File object describing the watermark image. |
void |
setOpacity(int opacity)
Specifies the opacity of the watermark as a value between 0 and 255, inclusive.
|
void |
setPercent(int percent)
Specifies the scaling value of the watermark image as a percentage of the image's original size.
|
void |
setVertOffset(int offset)
Specifies the vertical distance, in twips, to move the watermark from the center.
|
public Watermark()
Watermark
object. This can be used to disable watermarks.public Watermark(java.io.File file, int opacity) throws OutsideInException
Watermark
object using the specified image file and opacity.file
- the image fileopacity
- the opacity of the watermark image as an integer between 0 and 255 inclusive (0 is disabled and 255 is fully opaqueOutsideInException
public Watermark(java.io.File file, int opacity, int verticalOffset, int horizontalOffset) throws OutsideInException
Watermark
object using the specified image file, opacity, and offsets.file
- the image fileopacity
- the opacity of the watermark image as an integer between 0 and 255 inclusive (0 is disabled and 255 is fully opaqueverticalOffset
- the vertical offset from center, in twips (negative values correspond to below center, and positive values correspond to above center)horizontalOffset
- the horizontal offset from center, in twips (negative values correspond to left of center, and positive values correspond to right of center)OutsideInException
public int getOpacity()
public void setOpacity(int opacity) throws OutsideInException
opacity
- the opacity valueOutsideInException
public int getPercent()
Watermark.ScaleModeValue.PERCENT
.public void setPercent(int percent)
Watermark.ScaleModeValue.PERCENT
.percent
- the scaling valuepublic java.io.File getImageFile()
File
object describing the watermark image.public void setImageFile(java.io.File file)
File
object describing the watermark image.file
- the watermark filepublic int getVertOffset()
public void setVertOffset(int offset)
offset
- the offset value in twipspublic int getHorzOffset()
public void setHorzOffset(int offset)
offset
- the offset value in twips