public class CPDFEditPage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
CPDFEditPage.EditUndoRedoCallback |
Modifier and Type | Field and Description |
---|---|
static int |
EditAreaTypeImage |
static int |
EditAreaTypeText |
static int |
EditAreaTypeUnknown |
static int |
LoadImage |
static int |
LoadNone |
static int |
LoadPath |
static int |
LoadText |
static int |
LoadTextImage |
Modifier and Type | Method and Description |
---|---|
boolean |
beginEdit(int type)
Enter edit mode
|
boolean |
canRedo()
Check whether the operation can be redone
|
boolean |
canUndo()
Check whether the operation can be undone
|
long |
copyImageArea(CPDFEditImageArea editImageArea)
Copy text box
|
long |
copyTextArea(CPDFEditTextArea editTextArea)
Copy text box
|
CPDFEditImageArea |
createNewImageArea(android.graphics.RectF frame,
android.graphics.Bitmap bitmap)
Create an image box.
|
CPDFEditImageArea |
createNewImageArea(android.graphics.RectF frame,
java.lang.String filepath,
java.lang.String maskpath)
Create an image box.
|
CPDFEditTextArea |
createNewTextArea(android.graphics.RectF frame,
java.lang.String fontName,
float fontSize,
int color,
boolean bold,
boolean italic)
Create text box.
|
CPDFEditTextArea |
createNewTextArea(android.graphics.RectF frame,
java.lang.String fontName,
float fontSize,
int color,
int alpha,
boolean bold,
boolean italic,
CPDFEditTextArea.PDFEditAlignType alignment)
Create text box.
|
long |
cutImageArea(CPDFEditImageArea editImageArea)
Cut image box
|
long |
cutTextArea(CPDFEditTextArea editTextArea)
Cut text box
|
void |
endEdit()
Exit edit mode
|
boolean |
findClose()
End searching.
|
boolean |
findStart(java.lang.String findwhat,
int options,
int start_index)
Start searching.
|
int |
getAreaInfoType(long editAreaInfoPtr)
Get the edit area type(EditTextArea or EditImageArea).
|
java.util.List<CPDFEditImageArea> |
getEditImageAreas()
Get all image boxes in the page.
|
java.util.List<CPDFEditPathArea> |
getEditPathAreas() |
java.util.List<CPDFEditTextArea> |
getEditTextAreas()
Get all text boxes in the page
|
java.util.ArrayList<CPDFEditFindSelection> |
getFinSelections()
Get search results.
|
int |
getPageNum()
Get current page index
|
int |
getTextAreaCount()
Get text box number in the page
|
boolean |
isValid()
Check whether the page is correct
|
CPDFEditImageArea |
pasteImageArea(long editImageAreaInfoPtr,
android.graphics.RectF frame)
Paste image box on the clipboard
|
CPDFEditTextArea |
pasteTextArea(long editTextAreaInfoPtr,
android.graphics.RectF frame)
Paste text box on the clipboard
|
CPDFEditTextArea |
PastTextAreaNoStyle(java.lang.String text,
android.graphics.RectF frame,
java.lang.String fontName,
float fontSize,
int color)
Paste text box on the clipboard without style.
|
CPDFEditArea |
redo()
Redo
|
void |
release()
release page
|
void |
removeArea(CPDFEditImageArea editImageArea)
Remove image box.
|
void |
removeArea(CPDFEditPathArea editPathArea)
Remove path box.
|
void |
removeArea(CPDFEditTextArea editTextArea)
Remove text box
|
void |
removeAreaForReplace(CPDFEditImageArea editImageArea)
Remove image box.
|
boolean |
renderEditPage(android.graphics.Bitmap bitmap,
float scale,
int width,
int height,
int startX,
int startY,
int drawSizeHor,
int drawSizeVer,
int bgColor,
int bgColor_a,
int rotate,
boolean drawAnnot,
boolean drawForm,
long[] editAreaArray) |
boolean |
renderEditPage(android.graphics.Bitmap bitmap,
int start_x,
int start_y,
int size_x,
int size_y,
int bgColor,
int bgColor_a,
int rotate,
boolean form,
long[] editAreaArray) |
CPDFEditImageArea |
replaceEditImageAreaWithBitmap(CPDFEditImageArea imageEditArea,
android.graphics.RectF frame,
android.graphics.Bitmap bitmap)
Replace the image box with a bitmap.
|
CPDFEditImageArea |
replaceEditImageAreaWithBitmap(CPDFEditImageArea imageEditArea,
android.graphics.RectF frame,
java.lang.String filepath,
java.lang.String maskpath)
Replace the image box.
|
void |
setEditUndoRedoCallback(CPDFEditPage.EditUndoRedoCallback editUndoRedoCallback)
Set callback to undo、redo
|
CPDFEditArea |
undo()
Undo
|
public static final int LoadNone
public static final int LoadText
public static final int LoadImage
public static final int LoadPath
public static final int LoadTextImage
public static final int EditAreaTypeUnknown
public static final int EditAreaTypeText
public static final int EditAreaTypeImage
public boolean beginEdit(int type)
type
- Edit typepublic int getTextAreaCount()
public java.util.List<CPDFEditTextArea> getEditTextAreas()
public java.util.List<CPDFEditImageArea> getEditImageAreas()
public java.util.List<CPDFEditPathArea> getEditPathAreas()
public void removeArea(CPDFEditTextArea editTextArea)
editTextArea
- The text box to removepublic void removeArea(CPDFEditImageArea editImageArea)
editImageArea
- The image box to remove.public void removeArea(CPDFEditPathArea editPathArea)
editPathArea
- The path box to remove.public void removeAreaForReplace(CPDFEditImageArea editImageArea)
editImageArea
- The image box to remove.public void endEdit()
returns whether to successfully exit edit mode.
public CPDFEditArea undo()
public CPDFEditArea redo()
public boolean canRedo()
public boolean canUndo()
public CPDFEditTextArea createNewTextArea(android.graphics.RectF frame, java.lang.String fontName, float fontSize, int color, boolean bold, boolean italic)
frame
- The area occupied by the text box.fontName
- Text font name.fontSize
- Text font size.color
- Text font color.public CPDFEditTextArea createNewTextArea(android.graphics.RectF frame, java.lang.String fontName, float fontSize, int color, int alpha, boolean bold, boolean italic, CPDFEditTextArea.PDFEditAlignType alignment)
frame
- The area occupied by the text box.fontName
- Text font name.fontSize
- Text font size.color
- Text font coloralpha
- Text alpha(0 - 255).bold
- Whether text is bold.italic
- Whether text is italic.alignment
- Text alignment type.public CPDFEditImageArea createNewImageArea(android.graphics.RectF frame, java.lang.String filepath, java.lang.String maskpath)
frame
- The area occupied by the image box.filepath
- Image file path.maskpath
- Mask image file path.public CPDFEditImageArea createNewImageArea(android.graphics.RectF frame, android.graphics.Bitmap bitmap)
frame
- The area occupied by the image box.bitmap
- The bitmap to be added to the created image box.public CPDFEditImageArea replaceEditImageAreaWithBitmap(CPDFEditImageArea imageEditArea, android.graphics.RectF frame, android.graphics.Bitmap bitmap)
imageEditArea
- Image box.frame
- The area occupied by the image box.bitmap
- The bitmap to replace the image box.public CPDFEditImageArea replaceEditImageAreaWithBitmap(CPDFEditImageArea imageEditArea, android.graphics.RectF frame, java.lang.String filepath, java.lang.String maskpath)
imageEditArea
- Image box.frame
- The The area occupied by the image box.filepath
- The bitmmap file path to replace the image box.maskpath
- The mask bitmmap file path.public long copyTextArea(CPDFEditTextArea editTextArea)
editTextArea
- The Text box to be copiedpublic int getAreaInfoType(long editAreaInfoPtr)
editAreaInfoPtr
- The point to the edit area.public long copyImageArea(CPDFEditImageArea editImageArea)
editImageArea
- The Image box to be copiedpublic long cutTextArea(CPDFEditTextArea editTextArea)
editTextArea
- The Text box to be copiedpublic long cutImageArea(CPDFEditImageArea editImageArea)
editImageArea
- The Image box to be copiedpublic CPDFEditTextArea pasteTextArea(long editTextAreaInfoPtr, android.graphics.RectF frame)
editTextAreaInfoPtr
- The pointer to the text box infoframe
- The position to pastepublic CPDFEditTextArea PastTextAreaNoStyle(java.lang.String text, android.graphics.RectF frame, java.lang.String fontName, float fontSize, int color)
text
- The text to paste.frame
- The position to paste.fontName
- The text font name.fontSize
- The text font size.color
- The text font color.public CPDFEditImageArea pasteImageArea(long editImageAreaInfoPtr, android.graphics.RectF frame)
editImageAreaInfoPtr
- The pointer to the image box infoframe
- The position to pastepublic void release()
public int getPageNum()
public boolean isValid()
public boolean findStart(java.lang.String findwhat, int options, int start_index)
findwhat
- options
- Search mode, more: CPDFTextSearcher.PDFSearchOptions
start_index
- public java.util.ArrayList<CPDFEditFindSelection> getFinSelections()
public boolean findClose()
public boolean renderEditPage(android.graphics.Bitmap bitmap, int start_x, int start_y, int size_x, int size_y, int bgColor, int bgColor_a, int rotate, boolean form, long[] editAreaArray)
public boolean renderEditPage(android.graphics.Bitmap bitmap, float scale, int width, int height, int startX, int startY, int drawSizeHor, int drawSizeVer, int bgColor, int bgColor_a, int rotate, boolean drawAnnot, boolean drawForm, long[] editAreaArray)
public void setEditUndoRedoCallback(CPDFEditPage.EditUndoRedoCallback editUndoRedoCallback)
editUndoRedoCallback
- UndoRedoCallback