public class

PDFNetInternalTools

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

Class Overview

The class PDFNetInternalTools. Encapsulates the conversion of a single document from one format to another. DocumentConversion instances are created through methods belonging to the Convert class. See Convert.WordToPDFConversion for an example.

Summary

Constants
int e_callback
int e_console
int e_debug
int e_debugger
int e_disabled
int e_disk
int e_error
int e_fatal
int e_info
int e_trace
int e_warning
Public Methods
static boolean checkDocIntegrity(PDFDoc doc)
Ensure that a document is well formed, and that its in-memory representation matches its backing filter.
static boolean configureLogFromJsonString(String config_string)
Attempt to configure the logging ssytem with a json configuration file.
static void disableLogBackend(int backend)
Disable a particular log backend.
static boolean enableLogBackend(int backend)
Enable a particular log backend.
static String getDefaultConfigFile()
Get the default configuration json file.
static String getPDFViewTileSummary()
Get a summary of the held tiles of all the know instances of PDFViewImplTiled.
static boolean isLogSystemAvailable()
Find out whether the logging system is built into this particular binary.
static void logMessage(int threshold, String message, String filename, int line_number)
Log a message to a particular stream using the core logging routines.
static void logStreamMessage(int threshold, String stream, String message, String filename, int line_number)
Log a message to a particular stream using the core logging routines.
static String runUniversalConversionTests(String path_with_docs)
Run universal conversion tests on all the documents found in the given path.
static void setAnalyticsHandler(AnalyticsHandlerCallback handler)
Set the current analytics handler.
static void setAssertHandler(AssertHandlerCallback handler)
Set the current assert handler.
static void setCutoffLogThreshold(int threshold)
set the global log cutoff.
static void setDefaultLogThreshold(int threshold)
set the log level for streams that do not otherwise have their level set.
static boolean setLogFileName(String log_filename)
Set the filename to log to.
static boolean setLogLocation(String log_directory, String log_filename)
Set the directory and filename to log to.
static void setThresholdForLogStream(String stream_name, int stream_threshold)
set the log level for some particular stream.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int e_callback

Constant Value: 2 (0x00000002)

public static final int e_console

Constant Value: 3 (0x00000003)

public static final int e_debug

Constant Value: 1 (0x00000001)

public static final int e_debugger

Constant Value: 0 (0x00000000)

public static final int e_disabled

Constant Value: 6 (0x00000006)

public static final int e_disk

Constant Value: 1 (0x00000001)

public static final int e_error

Constant Value: 4 (0x00000004)

public static final int e_fatal

Constant Value: 5 (0x00000005)

public static final int e_info

Constant Value: 2 (0x00000002)

public static final int e_trace

Constant Value: 0 (0x00000000)

public static final int e_warning

Constant Value: 3 (0x00000003)

Public Methods

public static boolean checkDocIntegrity (PDFDoc doc)

Ensure that a document is well formed, and that its in-memory representation matches its backing filter.

Parameters
doc -- The document to check.
Returns
  • The result of the integrity check.

public static boolean configureLogFromJsonString (String config_string)

Attempt to configure the logging ssytem with a json configuration file.

Parameters
config_string -- Configuration Data in json form.
Returns
  • Indicates if the configuration was successful.

public static void disableLogBackend (int backend)

Disable a particular log backend.

Parameters
backend -- The log backend to disable.

public static boolean enableLogBackend (int backend)

Enable a particular log backend.

Parameters
backend -- The log backend to enable.
Returns
  • Returns true if the backend is available and functioning.

public static String getDefaultConfigFile ()

Get the default configuration json file. You could then modify it and pass it into ConfigureLogFromJsonString.

Returns
  • The json string representing the default log configuration.

public static String getPDFViewTileSummary ()

Get a summary of the held tiles of all the know instances of PDFViewImplTiled.

Returns
  • The json string representing the tile summary.

public static boolean isLogSystemAvailable ()

Find out whether the logging system is built into this particular binary.

Returns
  • returns true if TRN_LOG_ENABLE is defined in core.

public static void logMessage (int threshold, String message, String filename, int line_number)

Log a message to a particular stream using the core logging routines.

Parameters
threshold -- the importance of this log message.
message -- the message to be logged.
filename -- the filename from which the log message originates.
line_number -- the line number from which the log message originates.

public static void logStreamMessage (int threshold, String stream, String message, String filename, int line_number)

Log a message to a particular stream using the core logging routines.

Parameters
threshold -- the importance of this log message.
stream -- the name of the stream to which the message belongs (a category label).
message -- the message to be logged.
filename -- the filename from which the log message originates.
line_number -- the line number from which the log message originates.

public static String runUniversalConversionTests (String path_with_docs)

Run universal conversion tests on all the documents found in the given path.

Parameters
path_with_docs -- The path to search within for documents to convert.
Returns
  • The json string representing the test results.

public static void setAnalyticsHandler (AnalyticsHandlerCallback handler)

Set the current analytics handler.

Parameters
handler -- an instance of an analytics handler.

public static void setAssertHandler (AssertHandlerCallback handler)

Set the current assert handler.

Parameters
handler -- an instance of an assert handler.

public static void setCutoffLogThreshold (int threshold)

set the global log cutoff. *No* log statements with a level less than this will pass.

Parameters
threshold -- The threshold. Entries with a priority greater than or equal to this level will be logged.

public static void setDefaultLogThreshold (int threshold)

set the log level for streams that do not otherwise have their level set.

Parameters
threshold -- Entries with a priority greater than or equal to this level will be logged.

public static boolean setLogFileName (String log_filename)

Set the filename to log to.

Parameters
log_filename -- the name of the file to log into.
Returns
  • returns true we were able to open a log file successfully.

public static boolean setLogLocation (String log_directory, String log_filename)

Set the directory and filename to log to. If the directory does not exist, it will be created.

Parameters
log_directory -- the path of the directory to log into.
log_filename -- the name of the file to log into.
Returns
  • returns true we were able to open a log file successfully.

public static void setThresholdForLogStream (String stream_name, int stream_threshold)

set the log level for some particular stream.

Parameters
stream_name -- the name of the stream you wish to configure.
stream_threshold -- the stream threshold. Entries with a priority greater than or equal to this level will be logged.