public class

ReflowProcessor

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.ReflowProcessor

Class Overview

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.

Summary

Public Constructors
ReflowProcessor()
Public Methods
static void cancelAllRequests()
cancel all job requests.
static void cancelRequest(Page page)
cancel the request associated with a certain page.
static void clearCache()
clear the reflow disk cache.
static void getReflow(Page page, RequestHandler proc, Object custom_data)
request for extracting reflow from a given page.
static void initialize()
initialize reflow cache and job queues.
static void initialize(String noContent, String failedContent)
initialize reflow cache and job queues.
static boolean isInitialized()
check if reflow has been already initialized.
static void setNoReflowContent(String content)
Sets the content when a page doesn't contain reflowable text.
static void setReflowFailedContent(String content)
Sets the content when it is failed to extract reflowable text.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ReflowProcessor ()

Public Methods

public static void cancelAllRequests ()

cancel all job requests.

public static void cancelRequest (Page page)

cancel the request associated with a certain page.

Parameters
page The Page that the reflow processing request should be canecelled for.

public static void clearCache ()

clear the reflow disk cache.

public static void getReflow (Page page, RequestHandler proc, Object custom_data)

request for extracting reflow from a given page.

Parameters
proc - A callback function that will be called after the reflowable html file is created, or if it fails or cancels.
custom_data - Custom data to be passed to the RequestHandler.

public static void initialize ()

initialize reflow cache and job queues.
Note
calling this method clears everything in reflow disk cache.

public static void initialize (String noContent, String failedContent)

initialize reflow cache and job queues.
Note
calling this method clears everything in reflow disk cache.

Parameters
noContent - The string to show when a page doesn't contain reflowable text
failedContent - The string to show when it failed to extract reflowable text

public static boolean isInitialized ()

check if reflow has been already initialized.

Returns
  • true if reflow has been initialized; false otherwise.

public static void setNoReflowContent (String content)

Sets the content when a page doesn't contain reflowable text. Must only be called once, after initialize.

Parameters
content - The string to show when a page doesn't contain reflowable text

public static void setReflowFailedContent (String content)

Sets the content when it is failed to extract reflowable text. Must only be called once, after initialize.

Parameters
content - The string to show when it failed to extract reflowable text