Foxit PDF SDK
com.foxit.sdk.addon.accessibility.ReadingOrder Class Reference
Inheritance diagram for com.foxit.sdk.addon.accessibility.ReadingOrder:
com.foxit.sdk.common.Base

Public Member Functions

 ReadingOrder (PDFDoc pdf_doc) throws com.foxit.sdk.PDFException
 Constructor.
More...
 
 ReadingOrder (ReadingOrder other)
 Constructor, with another reading order object.
More...
 
RectFArray addOrderDataForRect (int page_index, RectF rect) throws com.foxit.sdk.PDFException
 Add order data for selected rect.
More...
 
boolean applyReadingOrder (int page_index, RectFArray selected_rect) throws com.foxit.sdk.PDFException
 Apply reading order to the specified page based on the given selected rectangle area(s).
More...
 
boolean canMoveDataOrder (int page_index, TreeItemInfoArray select_info_array, TreeItemInfo dest_move_item) throws com.foxit.sdk.PDFException
 Check whether data order can be moved.
More...
 
int canSelectTableCellAtPoint (PDFPage page, PointF point) throws com.foxit.sdk.PDFException
 Check whether a table cell can be selected on mouse down at the given point.
More...
 
void clearPageStructInfo (PDFPage page) throws com.foxit.sdk.PDFException
 Clear page structure info.
More...
 
synchronized void delete ()
 Clean up related C++ resources immediately. More...
 
int deleteOrderDataStructInfo (PDFPage page, Int32Array src_order_index_array, boolean is_loaded) throws com.foxit.sdk.PDFException
 Delete order data structure info.
More...
 
boolean drawReadingOrderItems (int page_index) throws com.foxit.sdk.PDFException
 Draw reading order items for a specified page.
More...
 
boolean endEditTable () throws com.foxit.sdk.PDFException
 End edit table.
More...
 
boolean generateTableHeaderIDs () throws com.foxit.sdk.PDFException
 Generate table header IDs.
More...
 
java.util.ArrayList< java.lang.String > getAllLeafChildrenByContentItemID (ContentTreeItemArray content_tree, String content_item_id) throws com.foxit.sdk.PDFException
 Get all leaf children by content item ID.
More...
 
ContentTreeItemArray getContentTree () throws com.foxit.sdk.PDFException
 Get content tree.
More...
 
WStringArray getCurrentTableHeaderIDs () throws com.foxit.sdk.PDFException
 Get the array header ID of current table.
More...
 
TreeItemArray getReadingOrderTreeItems () throws com.foxit.sdk.PDFException
 Get reading order tree items.
More...
 
TableCellAttributeArray getSelectedTableCellAttributes () throws com.foxit.sdk.PDFException
 Get selected table cell attributes.
More...
 
String getTableSummary (PDFPage page) throws com.foxit.sdk.PDFException
 Get table summary.
More...
 
boolean hasHeaderID (String header_id) throws com.foxit.sdk.PDFException
 Check whether current table header ID is existing.
More...
 
boolean hasMissingHeaderIDs () throws com.foxit.sdk.PDFException
 Check whether current table is missing header IDs.
More...
 
boolean isEditingTable () throws com.foxit.sdk.PDFException
 Check whether table editing has started.
More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 
int moveOrderData (int page_index, Int32Array src_order_index_array, int dest_order_index) throws com.foxit.sdk.PDFException
 Move data order.
More...
 
RectFArray removeOrderDataForRect (int page_index, RectF rect) throws com.foxit.sdk.PDFException
 Remove order data for selected rect.
More...
 
boolean selectTableAtPoint (int page_index, PointF point) throws com.foxit.sdk.PDFException
 Select the table at the specified point on a page, if any.
More...
 
int selectTableCellAtPoint (PDFPage page, PointF point, RectFArray region_selected, boolean appended) throws com.foxit.sdk.PDFException
 Select table cell by point on mouse up.
More...
 
int selectTableCellAtRect (PDFPage page, RectF rect, RectFArray region_selected, boolean appended) throws com.foxit.sdk.PDFException
 Select table cell by rect on mouse up.
More...
 
boolean setOrderTypeForSelectedContent (int structure_type) throws com.foxit.sdk.PDFException
 Set order type for selected content.
More...
 
boolean setOrderTypeForSelectedTreeItems (int structure_type, TreeItemInfoArray select_info_array) throws com.foxit.sdk.PDFException
 Set order type for selected tree items.
More...
 
void setReadingOrderOptions (ReadingOrderOptions options) throws com.foxit.sdk.PDFException
 Set reading order options.
More...
 
boolean setSelectedTableCellAttributes (TableCellAttribute cell_attribute, boolean change_id_enabled, boolean need_change_ids) throws com.foxit.sdk.PDFException
 Set selected table cell attributes.
More...
 
boolean setTableSummary (PDFPage page, String table_summary) throws com.foxit.sdk.PDFException
 Set table summary.
More...
 
boolean startEditTable (PDFPage page) throws com.foxit.sdk.PDFException
 Start edit table.
More...
 
boolean startEditTableAtPoint (PDFPage page, PointF point) throws com.foxit.sdk.PDFException
 Start editing the table located at the specified point on a page, if any.
More...
 
void synchronizeTable () throws com.foxit.sdk.PDFException
 Synchronize table.
More...
 

Static Public Attributes

static final int e_StructureTypeBackgroundOrArtifact = 16
 Structure type: background or artifact.

 
static final int e_StructureTypeCaption = 4
 Structure type: caption.

 
static final int e_StructureTypeCell = 12
 Structure type: cell.

 
static final int e_StructureTypeFigure = 1
 Structure type: figure.

 
static final int e_StructureTypeFigureOrCaption = 3
 Structure type: figure or caption.

 
static final int e_StructureTypeFormfield = 2
 Structure type: form field.

 
static final int e_StructureTypeFormula = 13
 Structure type: formula.

 
static final int e_StructureTypeH1 = 5
 Structure type: H1.

 
static final int e_StructureTypeH2 = 6
 Structure type: H2.

 
static final int e_StructureTypeH3 = 7
 Structure type: H3.

 
static final int e_StructureTypeH4 = 8
 Structure type: H4.

 
static final int e_StructureTypeH5 = 9
 Structure type: H5.

 
static final int e_StructureTypeH6 = 10
 Structure type: H6.

 
static final int e_StructureTypeNote = 15
 Structure type: note.

 
static final int e_StructureTypeReference = 14
 Structure type: reference.

 
static final int e_StructureTypeTable = 11
 Structure type: table.

 
static final int e_StructureTypeText = 0
 Structure type: text.

 
static final int e_TableSelectResultNone = 0
 Table select result : none.

 
static final int e_TableSelectResultNoTableExist = 3
 Table select result : no table exist.

 
static final int e_TableSelectResultNotInTable = 4
 Table select result : not in table.

 
static final int e_TableSelectResultNotSamePage = 2
 Table select result : not same page.

 
static final int e_TableSelectResultNotStarted = 1
 Table select result : not started.

 

Detailed Description

This class represents a reading order for PDF document accessibility reading order operations. Before using any class or methods in this module, please ensure Foxit PDF SDK has been initialized successfully by function common.Library.initialize with a key including "Accessibility" module.

See also
com.foxit.sdk.common.Library

Constructor & Destructor Documentation

◆ ReadingOrder() [1/2]

com.foxit.sdk.addon.accessibility.ReadingOrder.ReadingOrder ( PDFDoc  pdf_doc) throws com.foxit.sdk.PDFException

Constructor.

Parameters
[in]pdf_docA valid PDF document object.

◆ ReadingOrder() [2/2]

com.foxit.sdk.addon.accessibility.ReadingOrder.ReadingOrder ( ReadingOrder  other)

Constructor, with another reading order object.

Parameters
[in]otherAnother reading order object.

Member Function Documentation

◆ addOrderDataForRect()

RectFArray com.foxit.sdk.addon.accessibility.ReadingOrder.addOrderDataForRect ( int  page_index,
RectF  rect 
) throws com.foxit.sdk.PDFException

Add order data for selected rect.

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
[in]rectThe selected rect.
Returns
The updated order rect array.

◆ applyReadingOrder()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.applyReadingOrder ( int  page_index,
RectFArray  selected_rect 
) throws com.foxit.sdk.PDFException

Apply reading order to the specified page based on the given selected rectangle area(s).

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
[in]selected_rectThe array of selected rects which define the area(s) to be used for applying reading order.
Returns
true means success, while false means not.

◆ canMoveDataOrder()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.canMoveDataOrder ( int  page_index,
TreeItemInfoArray  select_info_array,
TreeItemInfo  dest_move_item 
) throws com.foxit.sdk.PDFException

Check whether data order can be moved.

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
[in]select_info_arrayThe selected info array.
[in]dest_move_itemThe destination move item.
Returns
true means data order can be moved, while false means not.

◆ canSelectTableCellAtPoint()

int com.foxit.sdk.addon.accessibility.ReadingOrder.canSelectTableCellAtPoint ( PDFPage  page,
PointF  point 
) throws com.foxit.sdk.PDFException

Check whether a table cell can be selected on mouse down at the given point.

Parameters
[in]pageA PDF page object.
[in]pointThe point, in the PDF coordinate system (PDFPage).
Returns
The table select result. Please refer to values starting from com.foxit.sdk.addon.accessibility.ReadingOrder.e_TableSelectResultNone .

◆ clearPageStructInfo()

void com.foxit.sdk.addon.accessibility.ReadingOrder.clearPageStructInfo ( PDFPage  page) throws com.foxit.sdk.PDFException

Clear page structure info.

Parameters
[in]pageThe PDF page object.
Returns
None.

◆ delete()

synchronized void com.foxit.sdk.addon.accessibility.ReadingOrder.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.

◆ deleteOrderDataStructInfo()

int com.foxit.sdk.addon.accessibility.ReadingOrder.deleteOrderDataStructInfo ( PDFPage  page,
Int32Array  src_order_index_array,
boolean  is_loaded 
) throws com.foxit.sdk.PDFException

Delete order data structure info.

Parameters
[in]pageThe PDF page object.
[in]src_order_index_arrayThe source order index array.
[in]is_loadedWhether the page is loaded.
Returns
The deleted count.

◆ drawReadingOrderItems()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.drawReadingOrderItems ( int  page_index) throws com.foxit.sdk.PDFException

Draw reading order items for a specified page.

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
Returns
true means success, while false means not.

◆ endEditTable()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.endEditTable ( ) throws com.foxit.sdk.PDFException

End edit table.

Returns
true means success, while false means not.

◆ generateTableHeaderIDs()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.generateTableHeaderIDs ( ) throws com.foxit.sdk.PDFException

Generate table header IDs.

Returns
true means success, while false means not.

◆ getAllLeafChildrenByContentItemID()

java.util.ArrayList< java.lang.String > com.foxit.sdk.addon.accessibility.ReadingOrder.getAllLeafChildrenByContentItemID ( ContentTreeItemArray  content_tree,
String  content_item_id 
) throws com.foxit.sdk.PDFException

Get all leaf children by content item ID.

Parameters
[in]content_treeThe content tree.
[in]content_item_idThe content item ID.
Returns
The array of leaf children IDs.

◆ getContentTree()

ContentTreeItemArray com.foxit.sdk.addon.accessibility.ReadingOrder.getContentTree ( ) throws com.foxit.sdk.PDFException

Get content tree.

Returns
The array of content tree items.

◆ getCurrentTableHeaderIDs()

WStringArray com.foxit.sdk.addon.accessibility.ReadingOrder.getCurrentTableHeaderIDs ( ) throws com.foxit.sdk.PDFException

Get the array header ID of current table.

Returns
The array of header ID.

◆ getReadingOrderTreeItems()

TreeItemArray com.foxit.sdk.addon.accessibility.ReadingOrder.getReadingOrderTreeItems ( ) throws com.foxit.sdk.PDFException

Get reading order tree items.

Returns
The array of reading order tree items.

◆ getSelectedTableCellAttributes()

TableCellAttributeArray com.foxit.sdk.addon.accessibility.ReadingOrder.getSelectedTableCellAttributes ( ) throws com.foxit.sdk.PDFException

Get selected table cell attributes.

Returns
The array of cell attribute objects.

◆ getTableSummary()

String com.foxit.sdk.addon.accessibility.ReadingOrder.getTableSummary ( PDFPage  page) throws com.foxit.sdk.PDFException

Get table summary.

Parameters
[in]pageThe PDF page object.
Returns
The table summary text.

◆ hasHeaderID()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.hasHeaderID ( String  header_id) throws com.foxit.sdk.PDFException

Check whether current table header ID is existing.

Parameters
[in]header_idThe header ID to check.
Returns
true means the header ID is existing, while false means not.

◆ hasMissingHeaderIDs()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.hasMissingHeaderIDs ( ) throws com.foxit.sdk.PDFException

Check whether current table is missing header IDs.

Returns
true means current table is missing header IDs, while false means not.

◆ isEditingTable()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.isEditingTable ( ) throws com.foxit.sdk.PDFException

Check whether table editing has started.

Returns
true means table editing has started, while false means not.

◆ isEmpty()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.isEmpty ( )

Check whether current object is empty or not.

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

◆ moveOrderData()

int com.foxit.sdk.addon.accessibility.ReadingOrder.moveOrderData ( int  page_index,
Int32Array  src_order_index_array,
int  dest_order_index 
) throws com.foxit.sdk.PDFException

Move data order.

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
[in]src_order_index_arrayThe source order index array.
[in]dest_order_indexThe destination order index.
Returns
The moved count.

◆ removeOrderDataForRect()

RectFArray com.foxit.sdk.addon.accessibility.ReadingOrder.removeOrderDataForRect ( int  page_index,
RectF  rect 
) throws com.foxit.sdk.PDFException

Remove order data for selected rect.

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
[in]rectThe selected rect.
Returns
The updated order rect array.

◆ selectTableAtPoint()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.selectTableAtPoint ( int  page_index,
PointF  point 
) throws com.foxit.sdk.PDFException

Select the table at the specified point on a page, if any.

Parameters
[in]page_indexThe page index. Valid range: from 0 to (count-1). count is returned by function pdf.PDFDoc.getPageCount .
[in]pointThe point used to locate the table, in PDF page coordinate system.
Returns
true means a table is found and selected at the specified point, while false means not.

◆ selectTableCellAtPoint()

int com.foxit.sdk.addon.accessibility.ReadingOrder.selectTableCellAtPoint ( PDFPage  page,
PointF  point,
RectFArray  region_selected,
boolean  appended 
) throws com.foxit.sdk.PDFException

Select table cell by point on mouse up.

Parameters
[in]pageA PDF page object.
[in]pointThe point.
[out]region_selectedThe selected region array.
[in]appendedWhether to append the selection.
Returns
The table select result. Please refer to values starting from com.foxit.sdk.addon.accessibility.ReadingOrder.e_TableSelectResultNone .

◆ selectTableCellAtRect()

int com.foxit.sdk.addon.accessibility.ReadingOrder.selectTableCellAtRect ( PDFPage  page,
RectF  rect,
RectFArray  region_selected,
boolean  appended 
) throws com.foxit.sdk.PDFException

Select table cell by rect on mouse up.

Parameters
[in]pageA PDF page object.
[in]rectThe rectangular area .
[out]region_selectedThe selected region array.
[in]appendedWhether to append the selection.
Returns
The table select result. Please refer to values starting from com.foxit.sdk.addon.accessibility.ReadingOrder.e_TableSelectResultNone .

◆ setOrderTypeForSelectedContent()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.setOrderTypeForSelectedContent ( int  structure_type) throws com.foxit.sdk.PDFException

Set order type for selected content.

Parameters
[in]structure_typeThe structure type. Please refer to values starting from and this should be one of these values.
Returns
true means success, while false means not.

◆ setOrderTypeForSelectedTreeItems()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.setOrderTypeForSelectedTreeItems ( int  structure_type,
TreeItemInfoArray  select_info_array 
) throws com.foxit.sdk.PDFException

Set order type for selected tree items.

Parameters
[in]structure_typeThe structure type. Please refer value .
[in]select_info_arrayThe selected info array.
Returns
true means success, while false means not.

◆ setReadingOrderOptions()

void com.foxit.sdk.addon.accessibility.ReadingOrder.setReadingOrderOptions ( ReadingOrderOptions  options) throws com.foxit.sdk.PDFException

Set reading order options.

Parameters
[in]optionsThe reading order options. Please refer to ReadingOrderOptions .
Returns
None.

◆ setSelectedTableCellAttributes()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.setSelectedTableCellAttributes ( TableCellAttribute  cell_attribute,
boolean  change_id_enabled,
boolean  need_change_ids 
) throws com.foxit.sdk.PDFException

Set selected table cell attributes.

Parameters
[in]cell_attributeThe cell attribute to set.
[in]change_id_enabledWhether to enable changing Id.
[in]need_change_idsWhether to change IDs.
Returns
true means success, while false means not.

◆ setTableSummary()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.setTableSummary ( PDFPage  page,
String  table_summary 
) throws com.foxit.sdk.PDFException

Set table summary.

Parameters
[in]pageThe PDF page object.
[in]table_summaryThe table summary text.
Returns
true means success, while false means not.

◆ startEditTable()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.startEditTable ( PDFPage  page) throws com.foxit.sdk.PDFException

Start edit table.

Parameters
[in]pageThe PDF page object.
Returns
true means success, while false means not.

◆ startEditTableAtPoint()

boolean com.foxit.sdk.addon.accessibility.ReadingOrder.startEditTableAtPoint ( PDFPage  page,
PointF  point 
) throws com.foxit.sdk.PDFException

Start editing the table located at the specified point on a page, if any.

Parameters
[in]pageThe PDF page object.
[in]pointThe point used to locate the table to be edited, in the PDF coordinate system (PDFPage).
Returns
true means a table is found at the specified point and editing has started successfully, while false means not.

◆ synchronizeTable()

void com.foxit.sdk.addon.accessibility.ReadingOrder.synchronizeTable ( ) throws com.foxit.sdk.PDFException

Synchronize table.

Returns
None.