Show / Hide Table of Contents

# Class HTML2PDF.WebPageSettings

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

##### Inheritance

object
HTML2PDF.WebPageSettings

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

###### Namespace: pdftron.PDF

###### Assembly: PDFNet.dll

##### Syntax

    public class HTML2PDF.WebPageSettings : IDisposable

### Constructors

#### WebPageSettings()

Default constructor

##### Declaration

    public WebPageSettings()

### Methods

#### Dispose()

Releases all resources used by the WebPageSettings

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected virtual void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

#### ~WebPageSettings()

##### Declaration

    protected ~WebPageSettings()

#### SetAllowJavaScript(bool)

Allow javascript from this web page to be run.

##### Declaration

    public void SetAllowJavaScript(bool enable)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enable | If true javascript's are allowed.

#### SetAllowPlugins(bool)

Allow Netscape and flash plugins from this web page to be run. Enabling will have limited success.

##### Declaration

    public void SetAllowPlugins(bool enable)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enable | If true Netscape and flash plugins will be run.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetBlockLocalFileAccess(bool)

Allow local and piped files access to other local files. By default local file access is blocked due to security concerns.

##### Declaration

    public void SetBlockLocalFileAccess(bool block)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | block | If true local files will be inaccessible. If false they will be be accessible which should only be used if the html is trusted.

#### SetConvertDelay(int)

Amount of time to wait before starting to convert html to pdf. Converter will wait msec milliseconds before calling convert.

##### Declaration

    public void SetConvertDelay(int msec)

##### Parameters

Type | Name | Description
--- | --- | ---
int | msec | Time to wait in milliseconds, e.g. 1200.

#### SetDebugJavaScriptOutput(bool)

Forward javascript warnings and errors to output.

##### Declaration

    public void SetDebugJavaScriptOutput(bool forward)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | forward | If true javascript errors and warnings will be forwarded to stdout and the log.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetDefaultEncoding(string)

Default encoding to be used when not specified by the web page.

##### Declaration

    public void SetDefaultEncoding(string encoding)

##### Parameters

Type | Name | Description
--- | --- | ---
string | encoding | Default encoding, e.g. utf-8 or iso-8859-1.

##### Remarks

Supported 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.

#### SetExternalLinks(bool)

Convert external links in HTML document to external PDF links.

##### Declaration

    public void SetExternalLinks(bool convert)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | convert | If true PDF pages produced from this web page can have external links.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetIncludeInOutline(bool)

Add sections from this web page to the outline and table of contents.

##### Declaration

    public void SetIncludeInOutline(bool include)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | include | 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.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetInternalLinks(bool)

Convert internal links in HTML document into PDF references.

##### Declaration

    public void SetInternalLinks(bool convert)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | convert | If true PDF pages produced from this web page will have links to other PDF pages.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetJavaScriptDelay(int)

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().

##### Declaration

    public void SetJavaScriptDelay(int msec)

##### Parameters

Type | Name | Description
--- | --- | ---
int | msec | Maximum wait time in milliseconds, e.g. 1200.

#### SetLoadErrorHandling(ErrorHandling)

How to handle objects that failed to load.

##### Declaration

    public void SetLoadErrorHandling(HTML2PDF.WebPageSettings.ErrorHandling type)

##### Parameters

Type | Name | Description
--- | --- | ---
HTML2PDF.WebPageSettings.ErrorHandling | type | If e_abort then conversion process is aborted, if e_skip then the converter will not add this web page to the PDF output, and if e_skip then the converter will try to add this web page to the PDF output.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetLoadImages(bool)

Print the images of this web page.

##### Declaration

    public void SetLoadImages(bool load)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | load | If true images are printed.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetMinimumFontSize(int)

Set the smallest font size allowed, e.g 9.

##### Declaration

    public void SetMinimumFontSize(int size)

##### Parameters

Type | Name | Description
--- | --- | ---
int | size | No fonts will appear smaller than this.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetPassword(string)

Password to use when logging into the website.

##### Declaration

    public void SetPassword(string password)

##### Parameters

Type | Name | Description
--- | --- | ---
string | password | The login password to use with the server, e.g. "elbarto".

#### SetPrintBackground(bool)

Print the background of this web page.

##### Declaration

    public void SetPrintBackground(bool background)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | background | If true background is printed.

#### SetPrintMediaType(bool)

Controls how content will be printed from this web page.

##### Declaration

    public void SetPrintMediaType(bool print)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | print | If true the print media type will be used, otherwise the screen media type will be used to print content.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetProduceForms(bool)

Turn HTML forms into PDF forms.

##### Declaration

    public void SetProduceForms(bool forms)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | forms | If true PDF pages produced from this web page will have PDF forms for any HTML forms the web page has.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetProxy(Proxy)

##### Declaration

    public void SetProxy(HTML2PDF.Proxy proxy)

##### Parameters

Type | Name | Description
--- | --- | ---
HTML2PDF.Proxy | proxy |

#### SetSmartShrinking(bool)

Allow intelligent shrinking to fit more content per page.

##### Declaration

    public void SetSmartShrinking(bool enable)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enable | If true intelligent shrinking is enabled and the pixel/dpi ratio is non constant.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetStopSlowScripts(bool)

Stop slow running javascript's.

##### Declaration

    public void SetStopSlowScripts(bool stop)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | stop | If true, slow running javascript's will be stopped.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetTimeout(int)

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.

##### Declaration

    public void SetTimeout(int msec)

##### Parameters

Type | Name | Description
--- | --- | ---
int | msec | Maximum timeout in milliseconds

#### SetUserStyleSheet(string)

Url or path to user specified style sheet.

##### Declaration

    public void SetUserStyleSheet(string url)

##### Parameters

Type | Name | Description
--- | --- | ---
string | url | URL or file path to user style sheet to be used with this web page.

##### Remarks

This option is deprecated in the latest HTML2PDF module and may have no effect.

#### SetUsername(string)

Username to use when logging into the website.

##### Declaration

    public void SetUsername(string username)

##### Parameters

Type | Name | Description
--- | --- | ---
string | username | The login name to use with the server, e.g. "bart".

#### SetZoom(double)

Zoom factor to use when loading object.

##### Declaration

    public void SetZoom(double zoom)

##### Parameters

Type | Name | Description
--- | --- | ---
double | zoom | How much to magnify the web content by, e.g. 2.2.

### Implements

IDisposable