PTReflowProcessor

@interface PTReflowProcessor : NSObject

ReflowProcessor is a processor that manages the requests of converting PDF page documents to reflow documents as HTML files. The output reflowable HTML file is identified by the requested page itself. For each PDF document that at least one of its page is requested for converting to reflow, a folder is created in cache directory. The folder name will be set to a unique ID of the PDF document (obtained from PDFUtil::GetUniqueIdString). Also, the output HTML file is obtained by the page object number. For example, the output HTML path of a PDF page with document ID of 2740180447,229945,WT1NOmJhyyH9xNqwbEbbOg== and object number of 123 will be ../trn_reflowcache/2740180447,229945,WT1NOmJhyyH9xNqwbEbbOg==/123.html

The cache is placed in the sub-directory ‘trn_reflowcache’ of the PDFNet Resources folder, which can be set by calling PDFNet::SetPersistentCachePath. In the case the PersistentCachePath is not set the HTML files will be stored in the system temp path (PDFNet::GetSystemTempPath()). The cache will be used by any PDFNet process that uses the resource path. If more than one PDFNet process is running concurrently, the first process to acquire a lock on the cache will use it. Subsequent processes will not read or modify the cache.

  • Initializes PDFNet library. Initialize must be called once, before any other PDFNet method is used. You must provide a trial or purchased license key. Please see https://www.pdftron.com/key_init_ios for more information.

    @exception If the license_key is missing or invalid, the function will throw an exception.

    Declaration

    Objective-C

    + (void)Initialize;

    Swift

    class func initialize()

    Parameters

    license_key

    The trial or purchased license key. Please see https://www.pdftron.com/key_init_ios for more information.

  • Checks whether reflow has been already initialized or not.

    Declaration

    Objective-C

    + (BOOL)IsInitialized;

    Swift

    class func isInitialized() -> Bool
  • Requests for extracting reflow from a page and calling back the proc handler thereafter

    Declaration

    Objective-C

    + (void)GetReflow:(PTPage *)page
                 proc:(PTJobRequestProcHandler)proc
          custom_data:(void *)custom_data;

    Swift

    class func getReflow(_ page: PTPage!, proc: PTJobRequestProcHandler!, custom_data: UnsafeMutableRawPointer!)

    Parameters

    page

    - The page

    proc

    - A callback function that will be called after the process is finished, or if that process fails

    custom_data

    - Custom data to be passed to the ProcHandler

  • Cancels all job requests.

    Declaration

    Objective-C

    + (void)CancelAllRequests;

    Swift

    class func cancelAllRequests()
  • Cancels the request associated with a certain page.

    Declaration

    Objective-C

    + (void)CancelRequest:(PTPage *)page;

    Swift

    class func cancelRequest(_ page: PTPage!)
  • clears the reflow disk cache.

    Declaration

    Objective-C

    + (void)ClearCache;

    Swift

    class func clearCache()
  • sets the content when a page doesn’t contain reflowable text

    Declaration

    Objective-C

    + (void)SetNoReflowContent:(NSString *)utf8_content;

    Swift

    class func setNoReflowContent(_ utf8_content: String!)
  • sets the content when it is failed to extract reflowable text

    Declaration

    Objective-C

    + (void)SetReflowFailedContent:(NSString *)utf8_content;

    Swift

    class func setReflowFailedContent(_ utf8_content: String!)
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()