Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.addon.pageeditor.ParagraphEditing Class Reference
Inheritance diagram for com.foxit.sdk.addon.pageeditor.ParagraphEditing:

## Public Member Functions
| ParagraphEditing (ParagraphEditing other)
| Constructor, with another paragraph edit object. More...
boolean | activate () throws com.foxit.sdk.PDFException
| Activate paragraph editing. More...
boolean | canCopy () throws com.foxit.sdk.PDFException
| Check whether can copy text. More...
boolean | canCut () throws com.foxit.sdk.PDFException
| Check whether can cut text. More...
boolean | canDelete () throws com.foxit.sdk.PDFException
| Check whether can delete text. More...
boolean | canDeselectAll () throws com.foxit.sdk.PDFException
| Check whether can deselect all text. More...
boolean | canPaste () throws com.foxit.sdk.PDFException
| Check whether can paste text. More...
boolean | canSelectAll () throws com.foxit.sdk.PDFException
| Check whether can select all text. More...
boolean | copySelected () throws com.foxit.sdk.PDFException
| Copy the selected text. More...
boolean | cutSelected () throws com.foxit.sdk.PDFException
| Cut the selected text. More...
boolean | deactivate () throws com.foxit.sdk.PDFException
| Deactivate paragraph editing. More...
void | dedent () throws com.foxit.sdk.PDFException
| Decrease indent for text. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
boolean | deleteSelected () throws com.foxit.sdk.PDFException
| Delete the selected text. More...
boolean | deselectAll () throws com.foxit.sdk.PDFException
| Deselect all text. More...
void | exitEditing (boolean is_end_directly) throws com.foxit.sdk.PDFException
| Exit paragraph editing. More...
void | indent () throws com.foxit.sdk.PDFException
| Increase indent for text. More...
boolean | insertText (String text) throws com.foxit.sdk.PDFException
| Call this function when insert text into the page. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
boolean | onChar (int char_code) throws com.foxit.sdk.PDFException
| Call this function when a character code is being input. More...
boolean | onKeyDown (int key_code) throws com.foxit.sdk.PDFException
| Call this function when key on the keyboard is down. More...
boolean | onKeyUp (int key_code) throws com.foxit.sdk.PDFException
| Call this function when key on the keyboard is up. More...
boolean | onLButtonDoubleClick (int page_index, PointF point) throws com.foxit.sdk.PDFException
| Call this function when left mouse button is double clicked. More...
boolean | onLButtonDown (int page_index, PointF point) throws com.foxit.sdk.PDFException
| Call this function when left mouse button is down. More...
boolean | onLButtonUp (int page_index, PointF point) throws com.foxit.sdk.PDFException
| Call this function when left mouse button is up. More...
boolean | onMouseMove (int page_index, PointF point) throws com.foxit.sdk.PDFException
| Call this function when mouse moves. More...
boolean | onMouseWheel (int page_index, PointF point, int delta) throws com.foxit.sdk.PDFException
| Call this function when scrolling the mouse wheel. More...
boolean | pasteSelected () throws com.foxit.sdk.PDFException
| Paste the copied text. More...
boolean | render (Int32Array page_index_array, Renderer renderer) throws com.foxit.sdk.PDFException
| Draw the current paragraph editing operation status on the rendering. More...
boolean | selectAll () throws com.foxit.sdk.PDFException
| Select all text. More...
void | setAlignment (int alignment) throws com.foxit.sdk.PDFException
| Set text alignment for text. More...
void | setBold (boolean is_bold) throws com.foxit.sdk.PDFException
| Set bold status for text. More...
void | setBulletedList (int bullet_type) throws com.foxit.sdk.PDFException
| Set bullet list for text. More...
void | setCharHorizontalScale (int scale) throws com.foxit.sdk.PDFException
| Set char horizontal scale for text. More...
void | setCharSpace (float char_space) throws com.foxit.sdk.PDFException
| Set char space for text. More...
void | setFontName (String font_name) throws com.foxit.sdk.PDFException
| Set font name for text. More...
void | setFontSize (float font_size) throws com.foxit.sdk.PDFException
| Set the font size for text. More...
void | setItalic (boolean is_italic) throws com.foxit.sdk.PDFException
| Set italic status for text. More...
void | setLineSpace (float line_space) throws com.foxit.sdk.PDFException
| Set line space for text. More...
void | setNumberedList (int numbering_type) throws com.foxit.sdk.PDFException
| Set the look of numbering for text. More...
void | setParagraphSpacing (float paragraph_space) throws com.foxit.sdk.PDFException
| Set paragraph spacing for text. More...
void | setStrikethrough (boolean is_striketrough) throws com.foxit.sdk.PDFException
| Set strikeout word style for text. More...
void | setSubscript (boolean is_subscript) throws com.foxit.sdk.PDFException
| Set the word property of subscript type for text. More...
void | setSuperscript (boolean is_superscript) throws com.foxit.sdk.PDFException
| Set the word property of superscript type for text. More...
void | setTextColor (long text_color) throws com.foxit.sdk.PDFException
| Set text color for text. More...
void | setUnderline (boolean is_underline) throws com.foxit.sdk.PDFException
| Set underline for text. More...
void | startEditing (int page_index, PointF start_point, PointF end_point) throws com.foxit.sdk.PDFException
| Start paragraph editing. More...

## Static Public Attributes
static final int | e_BulletTypeBlackDiamondMinusWhite = 8
| Bullet type: black diamond minus white.
static final int | e_BulletTypeCheck = 4
| Bullet type: check.
static final int | e_BulletTypeDiagonalUpRightArrow = 7
| Bullet type: diagonal up right arrow.
static final int | e_BulletTypeInverseTangentCircle = 6
| Bullet type: inverse tangent circle.
static final int | e_BulletTypeNone = 0
| Bullet type: none.
static final int | e_BulletTypeRightArrow = 5
| Bullet type: right arrow (upper white and lower black).
static final int | e_BulletTypeSolidCircle = 1
| Bullet type: solid circle.
static final int | e_BulletTypeSolidDiamond = 3
| Bullet type: solid diamond.
static final int | e_BulletTypeSolidRectangle = 2
| Bullet type: solid rectangle.
static final int | e_NumberingTypeDecimalDot = 1
| Numbering type: 1. 2. 3.
static final int | e_NumberingTypeDecimalRParen = 2
| Numbering type: 1) 2) 3)
static final int | e_NumberingTypeLowerLatinDot = 5
| Numbering type: a. b. c.
static final int | e_NumberingTypeLowerLatinRParen = 4
| Numbering type: a) b) c)
static final int | e_NumberingTypeNone = 0
| Numbering type: none.
static final int | e_NumberingTypeUpperLatinDot = 3
| Numbering type: A. B. C.

## Detailed Description

This class represents a paragraph edit operation. Before use any methods of paragraph edit function, please ensure the function ParagraphEditing.activate has been called. Please call the function ParagraphEditing.deactivate to deactivate when no need to use any paragraph edit function.

## Constructor & Destructor Documentation

## ◆ ParagraphEditing()

com.foxit.sdk.addon.pageeditor.ParagraphEditing.ParagraphEditing | ( | ParagraphEditing | other | ) |

Constructor, with another paragraph edit object.

Parameters

  [in] | other | Another paragraph edit object.

## Member Function Documentation

## ◆ activate()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.activate | ( |  | ) | throws com.foxit.sdk.PDFException

Activate paragraph editing.

Returns
  true means succeful, while false means not.

## ◆ canCopy()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.canCopy | ( |  | ) | throws com.foxit.sdk.PDFException

Check whether can copy text.

Returns
  true means current selected text object can be copied, while false means not.

## ◆ canCut()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.canCut | ( |  | ) | throws com.foxit.sdk.PDFException

Check whether can cut text.

Returns
  true means current selected text can be cut, while false means not.

## ◆ canDelete()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.canDelete | ( |  | ) | throws com.foxit.sdk.PDFException

Check whether can delete text.

Returns
  true means current selected text can be deleted, while false means not.

## ◆ canDeselectAll()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.canDeselectAll | ( |  | ) | throws com.foxit.sdk.PDFException

Check whether can deselect all text.

Returns
  true means current selected text can be deselected, while false means not.

## ◆ canPaste()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.canPaste | ( |  | ) | throws com.foxit.sdk.PDFException

Check whether can paste text.

Returns
  true means current selected text can be pasted, while false means not.

## ◆ canSelectAll()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.canSelectAll | ( |  | ) | throws com.foxit.sdk.PDFException

Check whether can select all text.

Returns
  true means current all text can be selected, while false means not.

## ◆ copySelected()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.copySelected | ( |  | ) | throws com.foxit.sdk.PDFException

Copy the selected text.

Returns
  true means success, while false means failure.

## ◆ cutSelected()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.cutSelected | ( |  | ) | throws com.foxit.sdk.PDFException

Cut the selected text.

Returns
  true means success, while false means failure.

## ◆ deactivate()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.deactivate | ( |  | ) | throws com.foxit.sdk.PDFException

Deactivate paragraph editing.

Returns
  true means success, while false means failure.

## ◆ dedent()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.dedent | ( |  | ) | throws com.foxit.sdk.PDFException

Decrease indent for text.

Returns
  None.

## ◆ delete()

synchronized void com.foxit.sdk.addon.pageeditor.ParagraphEditing.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

## ◆ deleteSelected()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.deleteSelected | ( |  | ) | throws com.foxit.sdk.PDFException

Delete the selected text.

Returns
  true means success, while false means failure.

## ◆ deselectAll()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.deselectAll | ( |  | ) | throws com.foxit.sdk.PDFException

Deselect all text.

Returns
  true means success, while false means failure.

## ◆ exitEditing()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.exitEditing | ( | boolean | is_end_directly | ) | throws com.foxit.sdk.PDFException

Exit paragraph editing.

Parameters

  [in] | is_end_directly | Whether to end editing directly.

Returns
  None.

## ◆ indent()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.indent | ( |  | ) | throws com.foxit.sdk.PDFException

Increase indent for text.

Returns
  None.

## ◆ insertText()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.insertText | ( | String | text | ) | throws com.foxit.sdk.PDFException

Call this function when insert text into the page.

Parameters

  [in] | text | The text to be inserted.

Returns
  true means success, while false means failure.

## ◆ isEmpty()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.isEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ onChar()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onChar | ( | int | char_code | ) | throws com.foxit.sdk.PDFException

Call this function when a character code is being input.

Parameters

  [in] | char_code | A character code, in UTF16-LE encoding.

Returns
  true means success, while false means failure.

## ◆ onKeyDown()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onKeyDown | ( | int | key_code | ) | throws com.foxit.sdk.PDFException

Call this function when key on the keyboard is down.

Parameters

  [in] | key_code | The key code. Please refer to values starting from com.foxit.sdk.pdf.interform.Filler.e_VkeyUnknown and this should be one of these values.

Returns
  true means success, while false means failure.

## ◆ onKeyUp()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onKeyUp | ( | int | key_code | ) | throws com.foxit.sdk.PDFException

Call this function when key on the keyboard is up.

Parameters

  [in] | key_code | The key code. Please refer to values starting from com.foxit.sdk.pdf.interform.Filler.e_VkeyUnknown and this should be one of these values.

Returns
  true means success, while false means failure.

## ◆ onLButtonDoubleClick()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onLButtonDoubleClick | ( | int | page_index,
|  | PointF | point
| ) |  | throws com.foxit.sdk.PDFException

Call this function when left mouse button is double clicked.

Parameters

  [in] | page_index | The page index.
  [in] | point | A point where left mouse button is double-clicked in the page, in device coordinate system.

Returns
  true means success, while false means failure.

## ◆ onLButtonDown()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onLButtonDown | ( | int | page_index,
|  | PointF | point
| ) |  | throws com.foxit.sdk.PDFException

Call this function when left mouse button is down.

Parameters

  [in] | page_index | The page index.
  [in] | point | A point where left mouse button is down in the page, in device coordinate system.

Returns
  true means success, while false means failure.

## ◆ onLButtonUp()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onLButtonUp | ( | int | page_index,
|  | PointF | point
| ) |  | throws com.foxit.sdk.PDFException

Call this function when left mouse button is up.

Parameters

  [in] | page_index | The page index.
  [in] | point | A point where left mouse button is up in the page, in device coordinate system.

Returns
  true means success, while false means failure.

## ◆ onMouseMove()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onMouseMove | ( | int | page_index,
|  | PointF | point
| ) |  | throws com.foxit.sdk.PDFException

Call this function when mouse moves.

Parameters

  [in] | page_index | The page index.
  [in] | point | A point where the mouse in the page, in device coordinate system.

Returns
  true means success, while false means failure.

## ◆ onMouseWheel()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.onMouseWheel | ( | int | page_index,
|  | PointF | point,
|  | int | delta
| ) |  | throws com.foxit.sdk.PDFException

Call this function when scrolling the mouse wheel.

Parameters

  [in] | page_index | The page index.
  [in] | point | A point where the mouse in the page, in device coordinate system.
  [in] | delta | Indicates the amount the mouse wheel has been moved. A positive value means to be moved forward, and a negative value means to be moved backward.

Returns
  true means success, while false means failure.

## ◆ pasteSelected()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.pasteSelected | ( |  | ) | throws com.foxit.sdk.PDFException

Paste the copied text.

Returns
  true means success, while false means failure.

## ◆ render()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.render | ( | Int32Array | page_index_array,
|  | Renderer | renderer
| ) |  | throws com.foxit.sdk.PDFException

Draw the current paragraph editing operation status on the rendering.

The matrix used in the rendering process is returned by ParagraphEditingProviderCallback.getRenderMatrix .

Parameters

  [in] | page_index_array | The page index array to render.
  [in] | renderer | A valid renderer object for rendering.

Returns
  true means success, while false means failure.

## ◆ selectAll()

boolean com.foxit.sdk.addon.pageeditor.ParagraphEditing.selectAll | ( |  | ) | throws com.foxit.sdk.PDFException

Select all text.

Returns
  true means success, while false means failure.

## ◆ setAlignment()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setAlignment | ( | int | alignment | ) | throws com.foxit.sdk.PDFException

Set text alignment for text.

Parameters

  [in] | alignment | Alignment value.Please refer to values starting from com.foxit.sdk.common.Constants.e_AlignmentLeft and this should be one of these values.

Returns
  None.

## ◆ setBold()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setBold | ( | boolean | is_bold | ) | throws com.foxit.sdk.PDFException

Set bold status for text.

Parameters

  [in] | is_bold | Whether to set selected text as bold. true means current selected text will be set as bold, while false means not.

Returns
  None.

## ◆ setBulletedList()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setBulletedList | ( | int | bullet_type | ) | throws com.foxit.sdk.PDFException

Set bullet list for text.

Before setting a bullet list, ensure the "wingding.ttf" font has been installed.

Parameters

  [in] | bullet_type | The type of bullet. Please refer to values starting from foxit::addon::pageeditor::e_BulletTypeNone and this should be one of these values.

Returns
  None.

## ◆ setCharHorizontalScale()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setCharHorizontalScale | ( | int | scale | ) | throws com.foxit.sdk.PDFException

Set char horizontal scale for text.

Parameters

  [in] | scale | The scale. It should be bigger than 0.

Returns
  None.

## ◆ setCharSpace()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setCharSpace | ( | float | char_space | ) | throws com.foxit.sdk.PDFException

Set char space for text.

Parameters

  [in] | char_space | The char space (unit is 1/72 inch).

Returns
  None.

## ◆ setFontName()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setFontName | ( | String | font_name | ) | throws com.foxit.sdk.PDFException

Set font name for text.

Parameters

  [in] | font_name | The font name.

Returns
  None.

## ◆ setFontSize()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setFontSize | ( | float | font_size | ) | throws com.foxit.sdk.PDFException

Set the font size for text.

Parameters

  [in] | font_size | The font size.

Returns
  None.

## ◆ setItalic()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setItalic | ( | boolean | is_italic | ) | throws com.foxit.sdk.PDFException

Set italic status for text.

Parameters

  [in] | is_italic | Whether to set selected text as italic. true means current selected text will be set as italic, while false means not.

Returns
  None.

## ◆ setLineSpace()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setLineSpace | ( | float | line_space | ) | throws com.foxit.sdk.PDFException

Set line space for text.

Parameters

  [in] | line_space | The line space (unit is 1/72 inch).

Returns
  None.

## ◆ setNumberedList()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setNumberedList | ( | int | numbering_type | ) | throws com.foxit.sdk.PDFException

Set the look of numbering for text.

Parameters

  [in] | numbering_type | The type of numbering. Please refer to values starting from foxit::addon::pageeditor::e_NumberingTypeNone and this should be one of these values.

Returns
  None.

## ◆ setParagraphSpacing()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setParagraphSpacing | ( | float | paragraph_space | ) | throws com.foxit.sdk.PDFException

Set paragraph spacing for text.

Parameters

  [in] | paragraph_space | The paragraph spacing.

Returns
  None.

## ◆ setStrikethrough()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setStrikethrough | ( | boolean | is_striketrough | ) | throws com.foxit.sdk.PDFException

Set strikeout word style for text.

Parameters

  [in] | is_striketrough | true means to set the strikeout word style, while false means not.

Returns
  None.

## ◆ setSubscript()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setSubscript | ( | boolean | is_subscript | ) | throws com.foxit.sdk.PDFException

Set the word property of subscript type for text.

Returns
  None.

## ◆ setSuperscript()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setSuperscript | ( | boolean | is_superscript | ) | throws com.foxit.sdk.PDFException

Set the word property of superscript type for text.

Returns
  None.

## ◆ setTextColor()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setTextColor | ( | long | text_color | ) | throws com.foxit.sdk.PDFException

Set text color for text.

Parameters

  [in] | text_color | The text color.

Returns
  None.

## ◆ setUnderline()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.setUnderline | ( | boolean | is_underline | ) | throws com.foxit.sdk.PDFException

Set underline for text.

Parameters

  [in] | is_underline | true means to underline text, while false means not.

Returns
  None.

## ◆ startEditing()

void com.foxit.sdk.addon.pageeditor.ParagraphEditing.startEditing | ( | int | page_index,
|  | PointF | start_point,
|  | PointF | end_point
| ) |  | throws com.foxit.sdk.PDFException

Start paragraph editing.

Parameters

  [in] | page_index | The page index.
  [in] | start_point | A point to start editing on the page, in the device coordinate system.
  [in] | end_point | A point to end editing on the page, in the device coordinate system.

Returns
  None.