Foxit PDF SDK
FSTaggedPDF Class Reference
Inheritance diagram for FSTaggedPDF:
FSBase

Instance Methods

(BOOL) - canTagDocument
 Check whether the current PDF document can be tagged.
More...
 
(BOOL) - canTagFormFields
 Check whether the form fields in the current PDF document can be auto tagged.
More...
 
(int) - getCurrentFigureElementIndex
 Get current figure element index.
More...
 
(NSString *) - getFigureAlternateText:
 Get the alternate text of the figure.
More...
 
(int) - getFigureCount
 Get the count of figures in tagged document, excluding the decorative figures.
More...
 
(int) - getFigurePageIndex:
 Get the figure page index by the figure index.
More...
 
(FSRectF *) - getFigureRect:
 Get the rectangle of figure.
More...
 
(FSAlternateTextFigureData *) - getNextFigureData
 Get next figure data.
More...
 
(FSAlternateTextFigureData *) - getPrevFigureData
 Get previous figure data.
More...
 
(BOOL) - hasFigures
 Check whether the document has figures.
More...
 
(id) - initWithDoc:is_fix:
 Constructor.
More...
 
(id) - initWithOther:
 Constructor, with another tagged PDF object.
More...
 
(BOOL) - isAlreadyTagged
 Check whether the current PDF document is already tagged.
More...
 
(BOOL) - isEmpty
 Check whether current object is empty or not.
More...
 
(void) - removeTags
 Remove the accessibility tag tree tree for the current PDF document.
More...
 
(BOOL) - saveFigureData
 Save figure data.
More...
 
(BOOL) - setAsDecorativeFigure:
 Decorate the figure.The decorative figure can not set alternate text.
More...
 
(void) - setCallback:
 
(void) - setCurrentFigureDataInfo:alternate_text:
 Set current figure data info.
More...
 
(void) - setFigureAlternateText:alternate_text:
 Set figure alternate text.
More...
 
(FSProgressive *) - startTagDocument:report_callback:callback:
 Start to auto tag the given PDF document with specified tagged settings.
More...
 
(BOOL) - tagFormFields
 Tag form fields in the current PDF document.
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 FSLibrary::initialize:key: with a key including "Accessibility" module.

See also
FSLibrary

Method Documentation

◆ canTagDocument()

- (BOOL) canTagDocument

Check whether the current PDF document can be tagged.

Returns
YES means the document can be tagged, while NO means not.

◆ canTagFormFields()

- (BOOL) canTagFormFields

Check whether the form fields in the current PDF document can be auto tagged.

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

Returns
YES means form fields can be auto tagged, while NO means not.

◆ getCurrentFigureElementIndex()

- (int) getCurrentFigureElementIndex

Get current figure element index.

Returns
The current figure element index.

◆ getFigureAlternateText:()

- (NSString *) getFigureAlternateText: (int)  figure_index

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 FSPDFDoc::isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters
[in]figure_indexThe index of figure. Valid range: from 0 to (count-1). count is returned by function FSTaggedPDF::getFigureCount.
Returns
The alternative descriptions text.

◆ getFigureCount()

- (int) getFigureCount

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 FSPDFDoc::isTaggedPDF to check current PDF document whether is a tagged PDF document.

Returns
The count of figures.

◆ getFigurePageIndex:()

- (int) getFigurePageIndex: (int)  figure_index

Get the figure page index by the figure index.

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

Parameters
[in]figure_indexThe index of figure. Valid range: from 0 to (count-1). count is returned by function FSTaggedPDF::getFigureCount.
Returns
The page index. Valid value would starts from 0. If there is any error, this function will return -1.

◆ getFigureRect:()

- (FSRectF *) getFigureRect: (int)  figure_index

Get the rectangle of figure.

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

Parameters
[in]figure_indexThe index of figure. Valid range: from 0 to (count-1). count is returned by function FSTaggedPDF::getFigureCount.
Returns
The figure rectangle.If there is any error, this function will return an empty rectangle.

◆ getNextFigureData()

- (FSAlternateTextFigureData *) getNextFigureData

Get next figure data.

Returns
The next figure data object.

◆ getPrevFigureData()

- (FSAlternateTextFigureData *) getPrevFigureData

Get previous figure data.

Returns
The previous figure data object.

◆ hasFigures()

- (BOOL) hasFigures

Check whether the document has figures.

Returns
YES means the document has figures, while NO means not.

◆ initWithDoc:is_fix:()

- (id) initWithDoc: (FSPDFDoc*)  doc
is_fix: (BOOL)  is_fix 

Constructor.

Parameters
[in]docA valid PDF document object to be tagged.
[in]is_fixWhether this tagged PDF is used for fix operation. If true, figure data methods will use fix alternate text; if false, they will use no-fix alternate text. Default value: NO.

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

◆ initWithOther:()

- (id) initWithOther: (FSTaggedPDF*)  other

Constructor, with another tagged PDF object.

Parameters
[in]otherAnother tagged PDF object.

◆ isAlreadyTagged()

- (BOOL) isAlreadyTagged

Check whether the current PDF document is already tagged.

Returns
YES means the document is already tagged, while NO means not.

◆ isEmpty()

- (BOOL) isEmpty

Check whether current object is empty or not.

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

Returns
YES means current object is empty, while NO means not.

◆ removeTags()

- (void) removeTags

Remove the accessibility tag tree tree for the current PDF document.

This method releases the accessibility-side tag tree/cache associated with the document.

Returns
None.

◆ saveFigureData()

- (BOOL) saveFigureData

Save figure data.

Returns
YES means success, while NO means not.

◆ setAsDecorativeFigure:()

- (BOOL) setAsDecorativeFigure: (int)  figure_index

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

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

Parameters
[in]figure_indexThe index of figure. Valid range: from 0 to (count-1). count is returned by function FSTaggedPDF::getFigureCount.
Returns
YES means decorate figure successed, while NO means not.

◆ setCallback:()

- (void) setCallback: (id<FSTaggedPDFCallback>)  callback
Deprecated:
This function has been deprecated since Foxit PDF SDK 12.0. Please use function FSTaggedPDF::startTagDocument:report_callback:callback: instead, which receives the report callbacks (report stream and localized report text) directly as parameters.

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

Parameters
[in]callbackA FSTaggedPDFCallback 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 nil, that means to use default information/data.
Returns
None.

◆ setCurrentFigureDataInfo:alternate_text:()

- (void) setCurrentFigureDataInfo: (BOOL)  is_decorative
alternate_text: (NSString *)  alternate_text 

Set current figure data info.

Parameters
[in]is_decorativeWhether the figure is decorative.
[in]alternate_textThe alternate text.
Returns
None.

◆ setFigureAlternateText:alternate_text:()

- (void) setFigureAlternateText: (int)  figure_index
alternate_text: (NSString *)  alternate_text 

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 FSPDFDoc::isTaggedPDF to check current PDF document whether is a tagged PDF document.

Parameters
[in]figure_indexThe index of figure. Valid range: from 0 to (count-1). count is returned by function FSTaggedPDF::getFigureCount.
[in]alternate_textThe alternative descriptions text.
Returns
None.

◆ startTagDocument:report_callback:callback:()

- (FSProgressive *) startTagDocument: (id<FSPauseCallback>)  pause
report_callback: (id<FSFileStreamCallback>)  report_callback
callback: (id<FSAutoTagProviderCallback>)  callback 

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

If user wants to get specific tag results during the tagging document process, please pass a valid report_callback and/or callback parameter to this function.

Parameters
[in]pausePause object which decides if the auto tagging process needs to be paused. This can be nil which means not to pause during the tagging process. If this is not nil, it should be a valid pause object implemented by user. Default value: nil.
[in]report_callbackA FSFileStreamCallback object used to receive the generated auto tag report stream. This can be nil which means not to output the report. If this is not nil, it should be a valid stream callback object implemented by user. Default value: nil.
[in]callbackAn FSAutoTagProviderCallback object which is implemented by user. User can provide the localized report text 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 nil, that means to use default report text.
Returns
A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.

◆ tagFormFields()

- (BOOL) tagFormFields

Tag form fields in the current PDF document.

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

Returns
YES means form fields tagged successfully, while NO means not.