Foxit PDF SDK
<FSAutoTagProviderCallback> Protocol Reference

Inherits <NSObject>.

Instance Methods

(NSString *) - getReportText:
 Get the display text for an auto tag result data type. More...
 

Detailed Description

This class represents an auto tag results provider for accessibility. All the pure virtual functions in this class are used as callback functions and should be implemented by user. An implemented FSAutoTagProviderCallback object can be passed to function FSTaggedPDF::startTagDocument:report_callback:callback:.

See also
FSTaggedPDF

Method Documentation

◆ getReportText:()

- (NSString *) getReportText: (FSAutoTagProviderCallbackAutoTagResultDataType)  type
required

Get the display text for an auto tag result data type.

This callback is invoked by the SDK while it generates the "Add Tags" report during auto tagging. For each result data type starting from FSAutoTagProviderCallbackAutoTagResultDataTypeReduceConfidence, the SDK requests the corresponding (typically localized) display string from the application, so the application controls all user-visible wording in the report.

Most types map to a plain label (for example "Figures", "Artifacts", "Table Summary"). A few types expect the returned string to contain a printf-style placeholder that the SDK substitutes at runtime; the implementation must keep the placeholder and its order intact:

  • %d page number (1-based): FSAutoTagProviderCallbackAutoTagResultDataTypePage ("Page %d"), FSAutoTagProviderCallbackAutoTagResultDataTypeMissFigure ("Figure missing AltText on page %d.");
  • %d count: FSAutoTagProviderCallbackAutoTagResultDataTypeSumReduceConfidence ("%d reduced confidence pages"), FSAutoTagProviderCallbackAutoTagResultDataTypeSumAlttextFigure ("%d figures missing AltText");
  • %ls category name: FSAutoTagProviderCallbackAutoTagResultDataTypeCheckCategory ("%ls to check."), FSAutoTagProviderCallbackAutoTagResultDataTypeFixCategory ("How to Fix %ls Tagging.");
  • %ls file name: FSAutoTagProviderCallbackAutoTagResultDataTypeTagreportFilename ("Add Tags Report for %ls").

Return an empty string for an unknown or unhandled type.

Parameters
[in]typeOne value of the result data types starting from FSAutoTagProviderCallbackAutoTagResultDataTypeReduceConfidence that the SDK is requesting text for.
Returns
The display text for type (may contain a placeholder as noted above), or an empty string if the type is not handled.