public abstract class CPDFAnnotation
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CPDFAnnotation.AppearanceType |
static interface |
CPDFAnnotation.Flags
A set of flags specifying various characteristics of the annotation.
|
static class |
CPDFAnnotation.Type
Annotation types
|
| Modifier and Type | Field and Description |
|---|---|
protected long |
annotPtr |
protected java.lang.Integer |
apRotation |
protected CPDFPage |
pdfPage |
| Modifier | Constructor and Description |
|---|---|
protected |
CPDFAnnotation(long annotPtr,
CPDFAnnotation.Type type) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToPage()
Adds annotation into PDF page
|
protected boolean |
clearFilledRGBColor()
Clear annotation fill color.
|
protected boolean |
clearFilledTransparency()
Clear annotation fill transparency.
|
void |
close()
When the object is no longer in use, call this method to release resources.
|
protected int[] |
getAppearanceByPixel(int width,
int height,
CPDFAnnotation.AppearanceType type)
Gets annotation appearance by pixel with Bitmap.
|
protected int |
getApRotation()
Gets rotation angle of annotation appearance.
|
protected float[] |
getBgRGBColor()
Gets background color of annotation.
|
protected float[] |
getBorderRGBColor()
Gets line color of annotation.
|
protected CPDFBorderStyle |
getBorderStyle()
Gets border style, more:
CPDFBorderStyle |
protected float |
getBorderWidth()
Gets border width of annotation.
|
java.lang.String |
getContent()
Gets annotation content.
|
CPDFDate |
getCreationDate()
Gets the creation date of annotation.
|
protected float[] |
getFilledRGBColor()
Gets annotation fill color.
|
protected float |
getFilledTransparency()
Gets fill color opacity.
|
int |
getFlags()
Gets annotation flags.
|
java.lang.String |
getName()
Not in use currently
|
protected java.lang.String |
getOverLayText() |
CPDFDate |
getRecentlyModifyDate()
Gets the modification date of annotation.
|
RectF |
getRect()
Gets annotation rectangle.
|
protected float[] |
getRGBColor()
Gets annotation color.
|
java.lang.String |
getTitle()
Not in use currently
|
protected float |
getTransparency()
Gets annotation opacity, Range 0-1, 0 is completely transparent, 1 is completely opaque.
|
CPDFAnnotation.Type |
getType()
Gets annotation type, more:
CPDFAnnotation.Type |
boolean |
hasAp()
Whether annotation has appearance.
|
boolean |
isAllowCorrectAnnotationAp()
Whether to allow to correct annotation appearance
|
boolean |
isHidden()
This is a convenience property that checks for `CPDFAnnotationFlagHidden` in `flags`.
|
boolean |
isLocked()
This is a convenience property that checks for `CPDFAnnotationFlagLocked` in `flags`.
|
protected boolean |
isReadOnly()
This is a convenience property that checks for `CPDFAnnotationFlagReadOnly` in `flags`.
|
boolean |
isValid()
Whether annotation object is valid.
|
protected boolean |
removeAp()
Removes annotation appearance.
|
boolean |
removeFromPage()
Removes annotation from PDF page
|
void |
setAllowCorrectAnnotationAp(boolean allowCorrectAnnotationAp)
Sets whether to allow to correct annotation appearance
|
protected boolean |
setBgRGBColor(float r,
float g,
float b)
Sets background color of annotation.
|
protected boolean |
setBorderRGBColor(float r,
float g,
float b)
Sets line color of annotation .
|
protected boolean |
setBorderStyle(CPDFBorderStyle borderStyle)
Sets border style, more:
CPDFBorderStyle |
protected boolean |
setBorderWidth(float width)
Sets border width of annotation.
|
boolean |
setContent(java.lang.String content)
Sets annotation content.
|
boolean |
setCreationDate(CPDFDate date)
Sets the creation date of annotation.
|
protected boolean |
setFilledRGBColor(float r,
float g,
float b)
Sets annotation fill color.
|
protected boolean |
setFilledTransparency(float transparency)
Sets fill color opacity.
|
boolean |
setFlags(int flag)
Sets annotation flag.
|
boolean |
setHidden(boolean isHidden)
This is a convenience property that checks for `CPDFAnnotationFlagHidden` in `flags`.
|
boolean |
setLocked(boolean isLocked)
This is a convenience property that checks for `CPDFAnnotationFlagLocked` in `flags`.
|
boolean |
setName(java.lang.String name)
Not in use currently
|
protected boolean |
setOverLayText(java.lang.String overlayText) |
protected boolean |
setReadOnly(boolean isReadOnly)
This is a convenience property that checks for `CPDFAnnotationFlagReadOnly` in `flags`.
|
boolean |
setRecentlyModifyDate(CPDFDate date)
Sets the modification date of annotation.
|
boolean |
setRect(RectF rect)
Sets annotation rectangle.
|
protected boolean |
setRGBColor(float r,
float g,
float b)
Sets annotation color.
|
boolean |
setTitle(java.lang.String title)
Not in use currently
|
protected boolean |
setTransparency(float transparency)
Sets annotation opacity, Range 0-1, 0 is completely transparent, 1 is completely opaque.
|
protected boolean |
updateAp()
Updates annotation appearance.
|
protected boolean |
updateApWithBitmap(int[] pixels,
int width,
int height)
Upadates annotation appearance by Bitmap.
|
protected boolean |
updateApWithImage(java.lang.String imagePath,
java.lang.String smaskPath)
Update annotation appearance with image.
|
protected long annotPtr
protected CPDFPage pdfPage
protected java.lang.Integer apRotation
protected CPDFAnnotation(long annotPtr,
CPDFAnnotation.Type type)
public CPDFAnnotation.Type getType()
CPDFAnnotation.Typepublic boolean isValid()
public boolean setRect(RectF rect)
rect - Rectangle on the page.public RectF getRect()
public boolean setFlags(int flag)
flag - Annotation flag.public int getFlags()
public boolean setHidden(boolean isHidden)
isHidden - True is hide,false otherwisepublic boolean isHidden()
public boolean setLocked(boolean isLocked)
isLocked - True is locked,false is unlockedpublic boolean isLocked()
protected boolean setReadOnly(boolean isReadOnly)
isReadOnly - True is readOnly,false otherwiseprotected boolean isReadOnly()
protected boolean setBorderWidth(float width)
width - Border width of annotation.protected float getBorderWidth()
protected boolean setRGBColor(float r,
float g,
float b)
r - Range 0-1g - Range 0-1b - Range 0-1protected float[] getRGBColor()
public boolean setContent(java.lang.String content)
content - Annotation content.public java.lang.String getContent()
public boolean setCreationDate(CPDFDate date)
date - Creation date of annotation.public CPDFDate getCreationDate()
public boolean setRecentlyModifyDate(CPDFDate date)
date - Modification date of annotation.public CPDFDate getRecentlyModifyDate()
public boolean setTitle(java.lang.String title)
public java.lang.String getTitle()
public boolean setName(java.lang.String name)
public java.lang.String getName()
protected boolean setTransparency(float transparency)
transparency - Annotation opacity.protected float getTransparency()
protected boolean setFilledRGBColor(float r,
float g,
float b)
r - Range 0-1g - Range 0-1b - Range 0-1protected float[] getFilledRGBColor()
protected boolean clearFilledRGBColor()
protected boolean setFilledTransparency(float transparency)
transparency - Fill color opacity, range 0-1protected float getFilledTransparency()
protected boolean clearFilledTransparency()
protected boolean setOverLayText(java.lang.String overlayText)
protected java.lang.String getOverLayText()
protected boolean setBorderRGBColor(float r,
float g,
float b)
r - Range 0-1g - Range 0-1b - Range 0-1protected float[] getBorderRGBColor()
protected boolean setBgRGBColor(float r,
float g,
float b)
r - Range 0-1g - Range 0-1b - Range 0-1protected float[] getBgRGBColor()
protected boolean setBorderStyle(CPDFBorderStyle borderStyle)
CPDFBorderStyleborderStyle - Border style, more: CPDFBorderStyleprotected CPDFBorderStyle getBorderStyle()
CPDFBorderStyleCPDFBorderStylepublic boolean removeFromPage()
public boolean addToPage()
public boolean hasAp()
protected boolean removeAp()
protected int getApRotation()
protected boolean updateAp()
protected boolean updateApWithImage(java.lang.String imagePath,
java.lang.String smaskPath)
imagePath - Original image pathsmaskPath - Mask image pathprotected boolean updateApWithBitmap(int[] pixels,
int width,
int height)
pixels - Bitmap pixels.width - Bitmap width.height - Bitmap height.protected int[] getAppearanceByPixel(int width,
int height,
CPDFAnnotation.AppearanceType type)
width - Bitmap width.height - Bitmap height.type - AppearanceType.public boolean isAllowCorrectAnnotationAp()
public void setAllowCorrectAnnotationAp(boolean allowCorrectAnnotationAp)
allowCorrectAnnotationAp - Whether to allow to correct annotation appearancepublic void close()