Skip navigation links

Oracle Outside In Java API Reference
8.5.4

E91699-01


com.oracle.outsidein.options
Class Watermark

java.lang.Object
  extended by com.oracle.outsidein.options.Watermark


public class Watermark
extends java.lang.Object

Describes a watermark image and its associated attributes.

See Also:
OptionsCache.getWatermark(), OptionsCache.setWatermark(Watermark)

Nested Class Summary
static class Watermark.AnchorPosition
          Indicates the starting location of the watermark image, and all offsets will be with respect to this anchor position.
static class Watermark.ScaleModeValue
          Indicates the method of scaling the watermark image.

 

Constructor Summary
Watermark()
          Create a disabled Watermark object.
Watermark(java.io.File file)
          Create a Watermark object using the specified image file and opacity.
Watermark(java.io.File file, int opacity, int percent, Watermark.AnchorPosition anchor, int vertOffset, int horzOffset)
          Create a Watermark object using the specified image file, opacity, and offsets.
Watermark(SeekableByteChannel6 redirect)
          Create a Watermark object using the specified redirected IO object and opacity.
Watermark(SeekableByteChannel6 redirect, int opacity, int percent, Watermark.AnchorPosition anchor, int vertOffset, int horzOffset)
          Create a Watermark object using the specified image file, opacity, and offsets.

 

Method Summary
 Watermark.AnchorPosition getAnchorPosition()
          Obtains the position at which the watermark image is anchored.
 int getHorzOffset()
          Obtains the horizontal distance, in twips, to move the watermark from the center.
 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 destination page size.
 int getVertOffset()
          Obtains the vertical distance, in twips, to move the watermark from the center.
 void setAnchorPosition(Watermark.AnchorPosition position)
          Specifies the position on each page where the watermark image is anchored.
 void setHorzOffset(int offset)
          Specifies the horizontal distance, in twips, to move the watermark from the center.
 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 destination page size.
 void setVertOffset(int offset)
          Specifies the vertical distance, in twips, to move the watermark from the center.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Watermark

public Watermark()
Create a disabled Watermark object. This can be used to disable watermarks.

Watermark

public Watermark(java.io.File file)
          throws OutsideInException
Create a Watermark object using the specified image file and opacity.
Parameters:
file - the image file between 0 and 255 inclusive (0 is disabled and 255 is fully opaque)
Throws:
OutsideInException

Watermark

public Watermark(SeekableByteChannel6 redirect)
          throws OutsideInException
Create a Watermark object using the specified redirected IO object and opacity.
Parameters:
redirect - the redirected IO object containing the image between 0 and 255 inclusive (0 is disabled and 255 is fully opaque)
Throws:
OutsideInException

Watermark

public Watermark(java.io.File file,
                 int opacity,
                 int percent,
                 Watermark.AnchorPosition anchor,
                 int vertOffset,
                 int horzOffset)
          throws OutsideInException
Create a Watermark object using the specified image file, opacity, and offsets.
Parameters:
file - the image file
opacity - the opacity of the watermark image as an integer between 0 and 255 inclusive (0 is disabled and 255 is fully opaque
percent - the scaling value of the watermark image as a percentage of the destination page size
anchor - the position on each page where the watermark image is anchored
vertOffset - the vertical offset from center, in twips (negative values correspond to below center, and positive values correspond to above center)
horzOffset - the horizontal offset from center, in twips (negative values correspond to left of center, and positive values correspond to right of center)
Throws:
OutsideInException

Watermark

public Watermark(SeekableByteChannel6 redirect,
                 int opacity,
                 int percent,
                 Watermark.AnchorPosition anchor,
                 int vertOffset,
                 int horzOffset)
          throws OutsideInException
Create a Watermark object using the specified image file, opacity, and offsets.
Parameters:
redirect - the redirected I/O object referencing the watermark image
opacity - the opacity of the watermark image as an integer between 0 and 255 inclusive (0 is disabled and 255 is fully opaque
percent - the scaling value of the watermark image as a percentage of the destination page size
anchor - the position on each page where the watermark image is anchored
vertOffset - the vertical offset from center, in twips (negative values correspond to below center, and positive values correspond to above center)
horzOffset - the horizontal offset from center, in twips (negative values correspond to left of center, and positive values correspond to right of center)
Throws:
OutsideInException

Method Detail

getOpacity

public int getOpacity()
Obtains the opacity of the watermark as a value between 0 and 255, inclusive. A value of 0 means the watermark is disabled. A value of 255 is fully opaque.
Returns:
the opacity value

setOpacity

public void setOpacity(int opacity)
                throws OutsideInException
Specifies the opacity of the watermark as a value between 0 and 255, inclusive. A value of 0 means the watermark is disabled. A value of 255 is fully opaque.
Parameters:
opacity - the opacity value
Throws:
OutsideInException

getPercent

public int getPercent()
Obtains the scaling value of the watermark image as a percentage of the destination page size. This value is only used if the scaling method is set to Watermark.ScaleModeValue.PERCENT.
Returns:
the scaling value

setPercent

public void setPercent(int percent)
Specifies the scaling value of the watermark image as a percentage of the destination page size. The scale may be set to a value from 0 to 100, inclusive. This method automatically sets the scaling method to Watermark.ScaleModeValue.PERCENT except if the percent value is set to 0, then the scaling method is set to Watermark.ScaleModeValue.NOSCALING
Parameters:
percent - the scaling value

getAnchorPosition

public Watermark.AnchorPosition getAnchorPosition()
Obtains the position at which the watermark image is anchored. All offsets are with respect to this anchor position.

setAnchorPosition

public void setAnchorPosition(Watermark.AnchorPosition position)
Specifies the position on each page where the watermark image is anchored. All offsets are with respect to this anchor position.
Parameters:
position - the position on each page

getVertOffset

public int getVertOffset()
Obtains the vertical distance, in twips, to move the watermark from the center. Negative values correspond to below center, and positive values correspond to above center.
Returns:
the offset value in twips

setVertOffset

public void setVertOffset(int offset)
Specifies the vertical distance, in twips, to move the watermark from the center. Negative values correspond to below center, and positive values correspond to above center. The default value is 0.
Parameters:
offset - the offset value in twips

getHorzOffset

public int getHorzOffset()
Obtains the horizontal distance, in twips, to move the watermark from the center. Negative values correspond to left of center, and positive values correspond to right of center.
Returns:
the offset value in twips

setHorzOffset

public void setHorzOffset(int offset)
Specifies the horizontal distance, in twips, to move the watermark from the center. Negative values correspond to left of center, and positive values correspond to right of center. The default value is 0.
Parameters:
offset - the offset value in twips

Skip navigation links

Oracle Outside In Java API Reference
8.5.4

E91699-01


Copyright © 2010, 2018, Oracle and/or its affiliates. All rights reserved.