Foxit PDF SDK

Public Member Functions | List of all members
com.foxit.sdk.addon.accessibility.TaggedPDF Class Reference
Inheritance diagram for com.foxit.sdk.addon.accessibility.TaggedPDF:

## Public Member Functions
| TaggedPDF (PDFDoc doc) throws com.foxit.sdk.PDFException
| Constructor. More...
| TaggedPDF (TaggedPDF other)
| Constructor, with another tagged PDF object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
String | getFigureAlternateText (int figure_index) throws com.foxit.sdk.PDFException
| Get the alternate text of the figure. More...
int | getFigureCount () throws com.foxit.sdk.PDFException
| Get the count of figures in tagged document, excluding the decorative figures. More...
int | getFigurePageIndex (int figure_index) throws com.foxit.sdk.PDFException
| Get the figure page index by the figure index. More...
RectF | getFigureRect (int figure_index) throws com.foxit.sdk.PDFException
| Get the rectangle of figure. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
boolean | setAsDecorativeFigure (int figure_index) throws com.foxit.sdk.PDFException
| Decorate the figure.The decorative figure can not set alternate text. More...
void | setCallback (TaggedPDFCallback callback) throws com.foxit.sdk.PDFException
| Set a callback object for tagged PDF. More...
void | setFigureAlternateText (int figure_index, String alternate_text) throws com.foxit.sdk.PDFException
| Set figure alternate text. More...
Progressive | startTagDocument (PauseCallback pause) throws com.foxit.sdk.PDFException
| Start to auto tag the given PDF document with specified tagged settings. More...

## Detailed Description

This class represents settings for a tagged PDF document.The tagged PDF means that only tagging information for PDF structure here. 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

## ◆ TaggedPDF() [1/2]

com.foxit.sdk.addon.accessibility.TaggedPDF.TaggedPDF | ( | PDFDoc | doc | ) | throws com.foxit.sdk.PDFException

Constructor.

Parameters

  [in] | doc | A valid PDF document object to be tagged.

This constructor is to construct a tagged PDF object with default settings.

## ◆ TaggedPDF() [2/2]

com.foxit.sdk.addon.accessibility.TaggedPDF.TaggedPDF | ( | TaggedPDF | other | ) |

Constructor, with another tagged PDF object.

Parameters

  [in] | other | Another tagged PDF object.

## Member Function Documentation

## ◆ delete()

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

## ◆ getFigureAlternateText()

String com.foxit.sdk.addon.accessibility.TaggedPDF.getFigureAlternateText | ( | int | figure_index | ) | throws com.foxit.sdk.PDFException

Get the alternate text of the figure.

The alternate text is the human-readable text, the PDF documents can be enhanced by providing alternate text for images, formulas, or other items that do not translate naturally into text. The function is only used for a tagged PDF document. Please call function pdf.PDFDoc.isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters

  [in] | figure_index | The index of figure. Valid range: from 0 to (count-1). count is returned by function TaggedPDF.getFigureCount .

Returns
  The alternative descriptions text.

## ◆ getFigureCount()

int com.foxit.sdk.addon.accessibility.TaggedPDF.getFigureCount | ( |  | ) | throws com.foxit.sdk.PDFException

Get the count of figures in tagged document, excluding the decorative figures.

The function is only used for a tagged PDF document. Please call function pdf.PDFDoc.isTaggedPDF to check current PDF document whether is a tagged PDF document.

Returns
  The count of figures.

## ◆ getFigurePageIndex()

int com.foxit.sdk.addon.accessibility.TaggedPDF.getFigurePageIndex | ( | int | figure_index | ) | throws com.foxit.sdk.PDFException

Get the figure page index by the figure index.

The function is only used for a tagged PDF document. Please call function pdf.PDFDoc.isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters

  [in] | figure_index | The index of figure. Valid range: from 0 to (count-1). count is returned by function TaggedPDF.getFigureCount .

Returns
  The page index. Valid value would starts from 0. If there is any error, this function will return -1.

## ◆ getFigureRect()

RectF com.foxit.sdk.addon.accessibility.TaggedPDF.getFigureRect | ( | int | figure_index | ) | throws com.foxit.sdk.PDFException

Get the rectangle of figure.

The function is only used for a tagged PDF document. Please call function pdf.PDFDoc.isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters

  [in] | figure_index | The index of figure. Valid range: from 0 to (count-1). count is returned by function TaggedPDF.getFigureCount .

Returns
  The figure rectangle.If there is any error, this function will return an empty rectangle.

## ◆ isEmpty()

boolean com.foxit.sdk.addon.accessibility.TaggedPDF.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.

## ◆ setAsDecorativeFigure()

boolean com.foxit.sdk.addon.accessibility.TaggedPDF.setAsDecorativeFigure | ( | int | figure_index | ) | throws com.foxit.sdk.PDFException

Decorate the figure.The decorative figure can not set alternate text.

The function is only used for a tagged PDF document. Please call function pdf.PDFDoc.isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters

  [in] | figure_index | The index of figure. Valid range: from 0 to (count-1). count is returned by function TaggedPDF.getFigureCount .

Returns
  true means decorate figure successed, while false means not.

## ◆ setCallback()

void com.foxit.sdk.addon.accessibility.TaggedPDF.setCallback | ( | TaggedPDFCallback | callback | ) | throws com.foxit.sdk.PDFException

Set a callback object for tagged PDF.

If this function is not called, that means no callback will be used.

Parameters

  [in] | callback | A TaggedPDFCallback object which is implemented by user. User can change some information/data during tagged PDF document by this callback. Please ensure that the callback object keeps valid until the life-cycle of current tagged PDF object ends. If this is null, that means to use default information/data.

Returns
  None.

## ◆ setFigureAlternateText()

void com.foxit.sdk.addon.accessibility.TaggedPDF.setFigureAlternateText | ( | int | figure_index,
|  | String | alternate_text
| ) |  | throws com.foxit.sdk.PDFException

Set figure alternate text.

The alternate text is the human-readable text, the PDF documents can be enhanced by providing alternate text for images, formulas, or other items that do not translate naturally into text. The function is only used for a tagged PDF document. Please call function pdf.PDFDoc.isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters

  [in] | figure_index | The index of figure. Valid range: from 0 to (count-1). count is returned by function TaggedPDF.getFigureCount .
  [in] | alternate_text | The alternative descriptions text.

Returns
  None.

## ◆ startTagDocument()

Progressive com.foxit.sdk.addon.accessibility.TaggedPDF.startTagDocument | ( | PauseCallback | pause | ) | throws com.foxit.sdk.PDFException

Start to auto tag the given PDF document with specified tagged settings.

If user wants to get specific tag results when tagging document process, please refer to function TaggedPDF.setCallback about callback function TaggedPDFCallback.report .

Parameters

  [in] | pause | Pause object which decides if the auto tagging process needs to be paused. This can be null which means not to pause during the tagging process. If this is not null, it should be a valid pause object implemented by user. Default value: null.

Returns
  A progressive object. Please check the rate of current progress by function common.Progressive.getRateOfProgress . If the rate is not 100 yet, call function common.Progressive.resume to continue the progress until the progress is finished.