public abstract class CPDFWatermark
extends java.lang.Object
CPDFImageWatermark
,
CPDFTextWatermark
Modifier and Type | Class and Description |
---|---|
static class |
CPDFWatermark.Horizalign
Horizontal alignment.
|
static class |
CPDFWatermark.Type
Watermark type.
|
static class |
CPDFWatermark.Vertalign
Vertical alignment.
|
Modifier and Type | Method and Description |
---|---|
boolean |
clear()
Removes watermark.
|
boolean |
create()
Not in use
|
java.lang.String |
getFontName()
Sets font of text watermark.
|
float |
getFontSize()
Gets font size of text watermark.
|
CPDFWatermark.Horizalign |
getHorizalign()
Gets watermark horizontal alignment.
|
float |
getHorizOffset()
Gets watermark horizontal deviation.
|
float |
getHorizontalSpacing()
Gets the horizontal spacing for the tiled watermark.
|
android.graphics.Bitmap |
getImage()
Gets watermark appearance.
|
float |
getOpacity()
Gets watermark opacity.
|
java.lang.String |
getPages()
Gets watermark page range.
|
float |
getRotation()
Gets watermark rotation angle.
|
float |
getScale()
Gets watermark zoom level.
|
java.lang.String |
getText()
Gets content of text watermark.
|
int |
getTextRGBColor()
Gets font color of text watermark.
|
CPDFWatermark.Type |
getType() |
CPDFWatermark.Vertalign |
getVertalign()
Gets watermark vertical alignment.
|
float |
getVerticalSpacing()
Gets vertical spacing for the tiled watermark.
|
float |
getVertOffset()
Gets watermark vertical deviation.
|
boolean |
isFront()
Whether watermark is in the front.
|
boolean |
isFullScreen()
Whether it is tiled watermark.
|
boolean |
isValid()
Whether object is valid, false means the object resource is released, you cannot use the object to call any method.
|
boolean |
release()
Releases Watermark object resource.
|
boolean |
saveImage(java.lang.String filePath,
java.lang.String smaskPath)
Saves watermark appearance as image.
|
boolean |
setFontName(java.lang.String fontName)
Sets font of text watermark.
|
boolean |
setFontSize(float fontSize)
Sets font size of text watermark.
|
boolean |
setFront(boolean isFront)
Sets watermark layer.
|
boolean |
setFullScreen(boolean isFullScreen)
Sets tiled watermark.
|
boolean |
setHorizalign(CPDFWatermark.Horizalign horizalign)
Sets horizontal alignment.
|
boolean |
setHorizOffset(float horizOffset)
Sets horizontal deviation.
|
boolean |
setHorizontalSpacing(float horizontalSpacing)
Sets the horizontal spacing for the tiled watermark.
|
boolean |
setImage(android.graphics.Bitmap bitmap,
int width,
int height)
Sets image watermark with Bitmap by pixel.
|
boolean |
setImage(java.lang.String imgPath,
java.lang.String smaskPath,
int width,
int height)
Sets image watermark with Bitmap.
|
boolean |
setOpacity(float opacity)
Sets opacity.
|
boolean |
setPages(java.lang.String pages)
Sets page range of watermark.
|
boolean |
setRotation(float rotation)
Sets rotation angle.
|
boolean |
setScale(float scale)
Sets zoom level.
|
boolean |
setText(java.lang.String text)
Sets content of text watermark.
|
boolean |
setTextRGBColor(int color)
Sets font color of text watermark.
|
boolean |
setVertalign(CPDFWatermark.Vertalign vertalign)
Sets vertical alignment.
|
boolean |
setVerticalSpacing(float verticalSpacing)
Sets vertical spacing for the tiled watermark.
|
boolean |
setVertOffset(float vertOffset)
Sets vertical deviation.
|
boolean |
update()
Updates watermark.
|
public CPDFWatermark.Type getType()
public boolean setScale(float scale)
scale
- Zoom level.public boolean setRotation(float rotation)
rotation
- Rotation angle.public boolean setOpacity(float opacity)
opacity
- Opacity.public boolean setVertalign(CPDFWatermark.Vertalign vertalign)
vertalign
- Vertical alignment.public boolean setHorizalign(CPDFWatermark.Horizalign horizalign)
horizalign
- Horizontal alignment.public boolean setVertOffset(float vertOffset)
vertOffset
- Vertical deviation.public boolean setHorizOffset(float horizOffset)
horizOffset
- Horizontal deviation.public boolean setPages(java.lang.String pages)
pages
- Page range,such as:1,2,3 or 1-3public boolean setFront(boolean isFront)
isFront
- Whether it is in front of text.public boolean setFullScreen(boolean isFullScreen)
isFullScreen
- Whether it is tiled watermark.public boolean setHorizontalSpacing(float horizontalSpacing)
horizontalSpacing
- Horizontal spacing for the tiled watermark.public boolean setVerticalSpacing(float verticalSpacing)
verticalSpacing
- Vertical spacing for the tiled watermark.public float getScale()
public float getRotation()
public float getOpacity()
public CPDFWatermark.Vertalign getVertalign()
public CPDFWatermark.Horizalign getHorizalign()
public float getVertOffset()
public float getHorizOffset()
public java.lang.String getPages()
public boolean isFront()
public boolean isFullScreen()
public float getHorizontalSpacing()
public float getVerticalSpacing()
public boolean setText(java.lang.String text)
text
- Content of text watermark.public boolean setFontName(java.lang.String fontName)
fontName
- Font of text watermark.public boolean setFontSize(float fontSize)
fontSize
- Font size of text watermarkpublic boolean setTextRGBColor(int color)
color
- Font color of text watermark.public java.lang.String getText()
public java.lang.String getFontName()
public float getFontSize()
public int getTextRGBColor()
public boolean setImage(java.lang.String imgPath, java.lang.String smaskPath, int width, int height)
imgPath
- Original image pathsmaskPath
- Mask image pathwidth
- Image widthheight
- Image heightpublic boolean setImage(android.graphics.Bitmap bitmap, int width, int height)
bitmap
- Image resource.width
- Image width.height
- Image height.public android.graphics.Bitmap getImage()
public boolean saveImage(java.lang.String filePath, java.lang.String smaskPath)
filePath
- Save path.smaskPath
- Save mask path.public boolean create()
public boolean clear()
public boolean update()
public boolean release()
public boolean isValid()