Class: WebPageSettings

PDFNet.HTML2PDF. WebPageSettings


new WebPageSettings()

Settings that control how a web page is opened and converted to PDF.

Extends

Members


<static> ErrorHandling

Type:
  • number
Properties:
Name Type Description
e_abort number
e_skip number
e_ignore number

Methods


<static> create()

Constructor
Returns:
A promise that resolves to an object of type: "PDFNet.HTML2PDF.WebPageSettings"
Type
Promise.<PDFNet.HTML2PDF.WebPageSettings>

destroy()

Destructor
Inherited From:
Returns:
Type
Promise.<void>

setAllowJavaScript(enable)

Allow javascript from this web page to be run.
Parameters:
Name Type Description
enable boolean If true javascript's are allowed.
Returns:
Type
Promise.<void>

setAllowPlugins(enable)

Allow Netscape and flash plugins from this web page to be run. Enabling will have limited success.
Parameters:
Name Type Description
enable boolean If true Netscape & flash plugins will be run. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setBlockLocalFileAccess(block)

Allow local and piped files access to other local files. By default local file access is blocked due to security concerns.
Parameters:
Name Type Description
block boolean If true local files will be inaccessible. If false they will be be accessible which should only be used if the html is trusted.
Returns:
Type
Promise.<void>

setConvertDelay(msec)

Amount of time to wait before starting to convert html to pdf. Converter will wait msec milliseconds before calling convert.
Parameters:
Name Type Description
msec number Time to wait in milliseconds, e.g. 1200.
Returns:
Type
Promise.<void>

setDebugJavaScriptOutput(forward)

Forward javascript warnings and errors to output.
Parameters:
Name Type Description
forward boolean If true javascript errors and warnings will be forwarded to stdout and the log. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setDefaultEncoding(encoding)

Default encoding to be used when not specified by the web page.
Parameters:
Name Type Description
encoding string Default encoding, e.g. utf-8 or iso-8859-1. Note: available encodings are Apple Roman, Big5, Big5-HKSCS, CP949, EUC-JP, EUC-KR, GB18030-0, IBM 850, IBM 866, IBM 874, ISO 2022-JP, ISO 8859-1 to 10, ISO 8859-13 to 16, Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, Tml, JIS X 0201, JIS X 0208, KOI8-R, KOI8-U, MuleLao-1, ROMAN8, Shift-JIS, TIS-620, TSCII, UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, Windows-1250 to 1258, WINSAMI2. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

Convert external links in HTML document to external PDF links.
Parameters:
Name Type Description
convert boolean If true PDF pages produced from this web page can have external links. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setIncludeInOutline(include)

Add sections from this web page to the outline and table of contents.
Parameters:
Name Type Description
include boolean If true PDF pages created from this web page will show up in the outline, and table of contents, otherwise, produced PDF pages will be excluded. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

Convert internal links in HTML document into PDF references.
Parameters:
Name Type Description
convert boolean If true PDF pages produced from this web page will have links to other PDF pages. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setJavaScriptDelay(msec)

Amount of time to wait for a web page to start printing after it's completed loading. Converter will wait a maximum of msec milliseconds for javascript to call window.print().
Parameters:
Name Type Description
msec number Maximum wait time in milliseconds, e.g. 1200.
Returns:
Type
Promise.<void>

setLoadErrorHandling(val)

Parameters:
Name Type Description
val number
PDFNet.HTML2PDF.WebPageSettings.ErrorHandling = {
	e_abort : 0
	e_skip : 1
	e_ignore : 2
}
Returns:
Type
Promise.<void>

setLoadImages(load)

Print the images of this web page.
Parameters:
Name Type Description
load boolean If true images are printed. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setMinimumFontSize(size)

Set the smallest font size allowed, e.g 9.
Parameters:
Name Type Description
size number No fonts will appear smaller than this. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setPassword(password)

HTTP authentication password to use when logging into the website.
Parameters:
Name Type Description
password string The login password to use with the server, e.g. "elbarto".
Returns:
Type
Promise.<void>

setPrintBackground(background)

Print the background of this web page.
Parameters:
Name Type Description
background boolean If true background is printed.
Returns:
Type
Promise.<void>

setPrintMediaType(print)

Controls how content will be printed from this web page.
Parameters:
Name Type Description
print boolean If true the print media type will be used, otherwise the screen media type will be used to print content. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setProduceForms(forms)

Turn HTML forms into PDF forms.
Parameters:
Name Type Description
forms boolean If true PDF pages produced from this web page will have PDF forms for any HTML forms the web page has. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setProxy(proxy)

Use this proxy to load content from this web page.
Parameters:
Name Type Description
proxy PDFNet.HTML2PDF.Proxy Contains settings for proxy
Returns:
Type
Promise.<void>

setSmartShrinking(enable)

Allow intelligent shrinking to fit more content per page.
Parameters:
Name Type Description
enable boolean If true intelligent shrinking is enabled and the pixel/dpi ratio is non constant. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setStopSlowScripts(stop)

Stop slow running javascript's.
Parameters:
Name Type Description
stop boolean If true, slow running javascript's will be stopped. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setTimeout(msec)

Amount of time to wait in milliseconds for the entire converting and printing process. If conversion doesn't finish before the timeout, it will be cancelled and no output is expected. Default 120,000 ms.
Parameters:
Name Type Description
msec number - Maximum timeout in milliseconds.
Returns:
Type
Promise.<void>

setUsername(username)

HTTP authentication username to use when logging into the website.
Parameters:
Name Type Description
username string The login name to use with the server, e.g. "bart".
Returns:
Type
Promise.<void>

setUserStyleSheet(url)

Url or path to user specified style sheet.
Parameters:
Name Type Description
url string URL or file path to user style sheet to be used with this web page. Note: This option is deprecated in the latest HTML2PDF module and may have no effect.
Returns:
Type
Promise.<void>

setZoom(zoom)

Zoom factor to use when loading object.
Parameters:
Name Type Description
zoom number How much to magnify the web content by, e.g. 2.2.
Returns:
Type
Promise.<void>

takeOwnership()

Take the ownership of this object, so that PDFNet.runWithCleanup won't destroy this object.
Inherited From:
Returns:
Type
void