Class: PDFNet

PDFNet. PDFNet


new PDFNet()

PDFNet contains global library initialization, registration, configuration, and termination methods.

Methods


<static> addResourceSearchPath(path)

Sets the location of PDFNet resource file.

Parameters:
Name Type Description
path string

The resource directory path to add to the search list.


<static> enableJavaScript(enable)

A switch that can be used to turn on/off JavaScript engine

Parameters:
Name Type Description
enable boolean

true to enable JavaScript engine, false to disable.


<static> getVersion()

Returns:

A promise that resolves to pDFNet version number.

Type
number

<static> isJavaScriptEnabled()

Test whether JavaScript is enabled

Returns:

A promise that resolves to true if it is enabled, false otherwise

Type
boolean

<static> setColorManagement(t)

used to set a specific Color Management System (CMS) for use during color conversion operators, image rendering, etc.

Parameters:
Name Type Description
t number/enum
PDFNet.CMSType = {
	e_lcms : 0
	e_icm : 1
	e_no_cms : 2
}

identifies the type of color management to use.


<static> setDefaultDeviceRGBProfile(icc_filename)

Parameters:
Name Type Description
icc_filename string

<static> setDefaultFlateCompressionLevel(level)

sets the default compression level for Flate (ZLib).

Parameters:
Name Type Description
level number

An integer in range 0-9 representing the compression value to use as a default for any Flate streams (e.g used to compress content streams, PNG images, etc). The library normally uses the default compression level (Z_DEFAULT_COMPRESSION). For most images, compression values in the range 3-6 compress nearly as well as higher levels, and do so much faster. For on-line applications it may be desirable to have maximum speed Z_BEST_SPEED = 1). You can also specify no compression (Z_NO_COMPRESSION = 0).

Default Value:
  • Z_DEFAULT_COMPRESSION (-1).

<static> setLogLevel(level)

Parameters:
Name Type Description
level number/enum
PDFNet.LogLevel = {
	e_LogLevel_Off : -1
	e_LogLevel_Fatal : 5
	e_LogLevel_Error : 4
	e_LogLevel_Warning : 3
	e_LogLevel_Info : 2
	e_LogLevel_Trace : 1
	e_LogLevel_Debug : 0
}