Foxit PDF SDK

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
FSDK.HTML2PDFSettingData Class Reference

## Public Member Functions
| constructor () const ructor(page_width
| Constructor. More...
| Set (page_width, page_height, is_to_page_scale, page_margin, is_convert_link, rotate_degrees, is_generate_tag, page_mode, to_generate_bookmarks, scaling_mode, encoding_format, to_render_images, to_remove_underline_for_link, to_set_headerfooter, headerfooter_title, headerfooter_url, bookmark_root_name, to_resize_objects, to_print_background, to_optimize_tag_tree, media_style, to_load_active_content, to_disable_sandbox, to_use_blacklist, to_hide_header, to_hide_footer)
| Set value. More...

## Public Attributes
page_mode | __pad0__: number to_generate_bookmarks
| The page mode used for the converting. Please refer to values starting from FSDK.HTML2PDFSettingData.e_PageModeSinglePage and this should be one of these values.
| bookmark_root_name
| The bookmark's root name.
| encoding_format
| The HTML encoding format Please refer to values starting from FSDK.HTML2PDFSettingData.e_EncodingFormatDefault and this should be one of these values.
| headerfooter_title
| The header-footer title which is content for center header.
| headerfooter_url
| The header-footer url which is content for left footer.
| is_convert_link
| Used to decide whether the web link should be converted or not.
| is_generate_tag
| Used to decide whether the tag should be generated or not.
| is_to_page_scale
| Used to decide whether to scale the converted PDF page or not. More...
| media_style
| The media style used for the converted PDF document. Please refer to values starting from FSDK.HTML2PDFSettingData.e_MediaStyleScreen and this should be one of these values.
| page_height
| The page height used for the converted PDF document (unit is 1/72 inch). More...
| page_margin
| The page margin used for converted PDF document. More...
| page_width
| The page width used for the converted PDF document (unit is 1/72 inch). More...
| rotate_degrees
| The rotation degree used for the converted PDF page.Please refer to values starting from FSDK.e_Rotation0 and this should be one of these values.
| scaling_mode
| The scaling mode used for the converted PDF document. Please refer to values starting from FSDK.HTML2PDFSettingData.e_ScalingModeNone and this should be one of these values.
| to_deny_local_file_access
| Used to decide whether to deny local file access or not during converting html file. More...
| to_disable_sandbox
| Used to decide whether to disable sandbox or not. More...
| to_hide_footer
| Used to decide whether to hide footer or not.
| to_hide_header
| Used to decide whether to hide header or not.
| to_load_active_content
| Used to decide whether to load active content or not. More...
| to_optimize_tag_tree
| Used to decide whether to optimize tag tree or not.
| to_print_background
| Used to decide whether to print background or not.
| to_remove_underline_for_link
| Used to decide whether to remove underline decoration for link.
| to_render_images
| Used to decide whether to render images or not.
| to_resize_objects
| Whether to enable the Javascripts related resizing of the objects during rendering process.
| to_set_headerfooter
| Used to decide whether to set header-footer or not.
| to_use_blacklist
| Used to decide whether to use blacklist or not. More...

## Static Public Attributes
static | _PageModeSinglePage
| Enumeration for page mode used for converting HTML to PDF. More...
static | e_EncodingFormatArabic
| Encoding foramt: "Arabic".
static | e_EncodingFormatASCII
| Encoding foramt: "ASCII".
static | e_EncodingFormatASCII_7_bit
| Encoding foramt: "ASCII-7-bit".
static | e_EncodingFormatBHASKAR
| Encoding foramt: "BHASKAR".
static | e_EncodingFormatBIG5
| Encoding foramt: "BIG5".
static | e_EncodingFormatBIG5_CP950
| Encoding foramt: "BIG5-CP950".
static | e_EncodingFormatBIG5_HKSCS
| Encoding foramt: "BIG5_HKSCS".
static | e_EncodingFormatCNS
| Encoding foramt: "CNS".
static | e_EncodingFormatCP1250
| Encoding foramt: "CP1250".
static | e_EncodingFormatCP1251
| Encoding foramt: "CP1251".
static | e_EncodingFormatCP1252
| Encoding foramt: "CP1252".
static | e_EncodingFormatCP1253
| Encoding foramt: "CP1253".
static | e_EncodingFormatCP1254
| Encoding foramt: "CP1254".
static | e_EncodingFormatCP1255
| Encoding foramt: "CP1255".
static | e_EncodingFormatCP1256
| Encoding foramt: "CP1256".
static | e_EncodingFormatCP1257
| Encoding foramt: "CP1257".
static | e_EncodingFormatCP852
| Encoding foramt: "CP852".
static | e_EncodingFormatCP866
| Encoding foramt: "CP866".
static | e_EncodingFormatCP874
| Encoding foramt: "CP874".
static | e_EncodingFormatCP932
| Encoding foramt: "CP932".
static | e_EncodingFormatCSN_369103
| Encoding foramt: "CSN_369103".
static | e_EncodingFormatDefault
| Enumeration for encoding format used for converting HTML to PDF. More...
static | e_EncodingFormatEUC
| Encoding foramt: "EUC".
static | e_EncodingFormatEUC_CN
| Encoding foramt: "EUC-CN".
static | e_EncodingFormatEUC_JP
| Encoding foramt: "EUC-JP".
static | e_EncodingFormatGB
| Encoding foramt: "GB".
static | e_EncodingFormatGB18030
| Encoding foramt: "GB18030".
static | e_EncodingFormatGBK
| Encoding foramt: "GBK".
static | e_EncodingFormatGreek
| Encoding foramt: "Greek".
static | e_EncodingFormatHebrew
| Encoding foramt: "Hebrew".
static | e_EncodingFormatHTCHANAKYA
| Encoding foramt: "HTCHANAKYA".
static | e_EncodingFormatHZ_GB_2312
| Encoding foramt: "HZ-GB-2312".
static | e_EncodingFormatISO_2022_CN
| Encoding foramt: "ISO_2022_CN".
static | e_EncodingFormatISO_2022_KR
| Encoding foramt: "ISO-2022-KR".
static | e_EncodingFormatISO_8859_11
| Encoding foramt: "ISO-8859-11".
static | e_EncodingFormatISO_8859_13
| Encoding foramt: "ISO-8859-13".
static | e_EncodingFormatISO_8859_15
| Encoding foramt: "ISO-8859-15".
static | e_EncodingFormatISO_8859_5
| Encoding foramt: "ISO-8859-5".
static | e_EncodingFormatISO_8859_8_I
| Encoding foramt: "ISO-8859-8-I".
static | e_EncodingFormatJAGRAN
| Encoding foramt: "JAGRAN".
static | e_EncodingFormatJIS
| Encoding foramt: "JIS".
static | e_EncodingFormatKOI8R
| Encoding foramt: "KOI8R".
static | e_EncodingFormatKOI8U
| Encoding foramt: "KOI8U".
static | e_EncodingFormatKSC
| Encoding foramt: "KSC".
static | e_EncodingFormatLatin2
| Encoding foramt: "Latin2".
static | e_EncodingFormatLatin3
| Encoding foramt: "Latin3".
static | e_EncodingFormatLatin4
| Encoding foramt: "Latin4".
static | e_EncodingFormatLatin5
| Encoding foramt: "Latin5".
static | e_EncodingFormatLatin6
| Encoding foramt: "Latin6".
static | e_EncodingFormatMACINTOSH
| Encoding foramt: "MACINTOSH".
static | e_EncodingFormatSJS
| Encoding foramt: "SJS".
static | e_EncodingFormatTAB
| Encoding foramt: "TAB".
static | e_EncodingFormatTAM
| Encoding foramt: "TAM".
static | e_EncodingFormatTSCII
| Encoding foramt: "TSCII".
static | e_EncodingFormatUnicode
| Encoding foramt: "Unicode".
static | e_EncodingFormatUTF7
| Encoding foramt: "UTF7".
static | e_EncodingFormatUTF_16BE
| Encoding foramt: "UTF-16BE".
static | e_EncodingFormatUTF_16LE
| Encoding foramt: "UTF-16LE".
static | e_EncodingFormatUTF_32BE
| Encoding foramt: "UTF-32BE".
static | e_EncodingFormatUTF_32LE
| Encoding foramt: "UTF-32LE".
static | e_EncodingFormatVISUAL
| Encoding foramt: "VISUAL".
static | e_EncodingFormatX_BINARYENC
| Encoding foramt: "X-BINARYENC".
static | e_EncodingFormatX_DoCoMo_Shift_JIS
| Encoding foramt: "X-DoCoMo-Shift_JIS".
static | e_EncodingFormatX_KDDI_ISO_2022_JP
| Encoding foramt: "X-KDDI-ISO-2022-JP".
static | e_EncodingFormatX_KDDI_Shift_JIS
| Encoding foramt: "X-KDDI-Shift_JIS".
static | e_EncodingFormatX_SoftBank_ISO_2022_JP
| Encoding foramt: "X-SoftBank-ISO-2022-JP".
static | e_EncodingFormatX_SoftBank_Shift_JIS
| Encoding foramt: "X-SoftBank-Shift_JIS".
static | e_EncodingFormatX_TAM_ELANGO
| Encoding foramt: "X-TAM-ELANGO".
static | e_EncodingFormatX_TAM_LTTMBARANI
| Encoding foramt: "X-TAM-LTTMBARANI".
static | e_EncodingFormatX_TAM_SHREE
| Encoding foramt: "X-TAM-SHREE".
static | e_EncodingFormatX_TAM_TBOOMIS
| Encoding foramt: "X-TAM-TBOOMIS".
static | e_EncodingFormatX_TAM_TMNEWS
| Encoding foramt: "X-TAM-TMNEWS".
static | e_EncodingFormatX_TAM_WEBTAMIL
| Encoding foramt: "X-TAM-WEBTAMIL".
static | e_EncodingFormatX_UTF8UTF8
| Encoding foramt: "X-UTF8UTF8".
static | e_MediaStylePrint
| Media style: print. It means PDF page will be displayed in print media style.
static | e_MediaStyleScreen
| Enumeration for media style used for converting HTML to PDF. More...
static | e_PageModeMultiplePage
| Multiple page mode.
static | e_ScalingModeEnlarge
| Page scaling: Enlarge. It means PDF page will be enlarged to HTML content size. In this mode, the text size of HTML content will not be changed.
static | e_ScalingModeNone
| Enumeration for scaling mode used for converting HTML to PDF. More...
static | e_ScalingModeScale
| Page scaling: Scale. It means HTML content will be scaled to fit PDF page size. In this mode, the text size may be changed.

## Detailed Description

This class represents setting data used for converting HTML to PDF.

## Member Function Documentation

## ◆ constructor()

FSDK.HTML2PDFSettingData.constructor | ( |  | ) | const

Constructor.

Constructor, with parameters.

Parameters

  [in] | page_width | The page width used for the converted PDF document (unit is 1/72 inch).
  [in] | page_height | The page height used for the converted PDF document (unit is 1/72 inch). This would be ignored if page mode FSDK.HTML2PDFSettingData.e_PageModeSinglePage is used.
  [in] | is_to_page_scale | (Deprecated)Used to decide whether to scale the converted PDF page or not.
  [in] | page_margin | The page margin used for converted PDF document.
  [in] | is_convert_link | Used to decide whether the web link should be converted or not.
  [in] | rotate_degrees | The rotation degree used for the converted PDF page.Please refer to values starting from FSDK.e_Rotation0 and this should be one of these values.
  [in] | is_generate_tag | Used to decide whether the tag should be generated or not.
  [in] | page_mode | The page mode used for the converting. Please refer to values starting from FSDK.HTML2PDFSettingData.e_PageModeSinglePage and this should be one of these values.
  [in] | to_generate_bookmarks | Used to decide whether bookmarks should be generated or not.
  [in] | scaling_mode | The scaling mode used for the converted PDF document. Please refer to values starting from FSDK.HTML2PDFSettingData.e_ScalingModeNone and this should be one of these values. Default value:FSDK.HTML2PDFSettingData.e_ScalingModeScale.
  [in] | encoding_format | The HTML encoding format Please refer to values starting from FSDK.HTML2PDFEncodingFormat.e_EncodingFormatDefault and this should be one of these values.
  [in] | to_render_images | Whether to render images or not.
  [in] | to_remove_underline_for_link | Whether to remove underline decoration for link or not.
  [in] | to_set_headerfooter | Whether to set header-footer or not.
  [in] | headerfooter_title | The header-footer title which is content for center header.
  [in] | headerfooter_url | The header-footer url which is content for left footer.
  [in] | bookmark_root_name | The bookmark's root name.
  [in] | to_resize_objects | Whether to enable the Javascripts related resizing of the objects during rendering process.
  [in] | to_print_background | Whether to print background or not.
  [in] | to_optimize_tag_tree | Whether to optimize tag tree or not.
  [in] | media_style | The media style used for the converted PDF document. Please refer to values starting from FSDK.HTML2PDFSettingData.e_MediaStyleScreen and this should be one of these values.
  [in] | to_load_active_content | Whether to load active content or not.
  [in] | to_disable_sandbox | Whether to disable sandbox or not.
  [in] | to_use_blacklist | Whether to use blacklist or not.
  [in] | to_hide_header | Whether to hide header or not.
  [in] | to_hide_footer | Whether to hide footer or not.
  [in] | to_deny_local_file_access | Whether to deny local file access or not.

Returns
  None.

## ◆ Set()

FSDK.HTML2PDFSettingData.Set | ( | page_width | ,
|  | page_height | ,
|  | is_to_page_scale | ,
|  | page_margin | ,
|  | is_convert_link | ,
|  | rotate_degrees | ,
|  | is_generate_tag | ,
|  | page_mode | ,
|  | to_generate_bookmarks | ,
|  | scaling_mode | ,
|  | encoding_format | ,
|  | to_render_images | ,
|  | to_remove_underline_for_link | ,
|  | to_set_headerfooter | ,
|  | headerfooter_title | ,
|  | headerfooter_url | ,
|  | bookmark_root_name | ,
|  | to_resize_objects | ,
|  | to_print_background | ,
|  | to_optimize_tag_tree | ,
|  | media_style | ,
|  | to_load_active_content | ,
|  | to_disable_sandbox | ,
|  | to_use_blacklist | ,
|  | to_hide_header | ,
|  | to_hide_footer |
| ) |  |

Set value.

Parameters

  [in] | page_width | The page width used for the converted PDF document (unit is 1/72 inch).
  [in] | page_height | The page height used for the converted PDF document (unit is 1/72 inch). This would be ignored if page mode FSDK.HTML2PDFSettingData.e_PageModeSinglePage is used.
  [in] | is_to_page_scale | (Deprecated)Used to decide whether to scale the converted PDF page or not.
  [in] | page_margin | The page margin used for converted PDF document.
  [in] | is_convert_link | Used to decide whether the web link should be converted or not.
  [in] | rotate_degrees | The rotation degree used for the converted PDF page.Please refer to values starting from FSDK.e_Rotation0 and this should be one of these values.
  [in] | is_generate_tag | Used to decide whether the tag should be generated or not.
  [in] | page_mode | The page mode used for the converting. Please refer to values starting from FSDK.HTML2PDFSettingData.e_PageModeSinglePage and this should be one of these values.
  [in] | to_generate_bookmarks | Used to decide whether bookmarks should be generated or not.
  [in] | scaling_mode | The scaling mode used for the converted PDF document. Please refer to values starting from FSDK.HTML2PDFSettingData.e_ScalingModeNone and this should be one of these values.Default value:FSDK.HTML2PDFSettingData.e_PageScalingScale.
  [in] | encoding_format | The HTML encoding format Please refer to values starting from FSDK.HTML2PDFEncodingFormat.e_EncodingFormatDefault and this should be one of these values.
  [in] | to_render_images | Whether to render images or not.
  [in] | to_remove_underline_for_link | Whether to remove underline decoration for link or not.
  [in] | to_set_headerfooter | Whether to set header-footer or not.
  [in] | headerfooter_title | The header-footer title which is content for center header.
  [in] | headerfooter_url | The header-footer url which is content for left footer.
  [in] | bookmark_root_name | The bookmark's root name.
  [in] | to_resize_objects | Whether to enable the Javascripts related resizing of the objects during rendering process.
  [in] | to_print_background | Whether to print background or not.
  [in] | to_optimize_tag_tree | Whether to optimize tag tree or not.
  [in] | media_style | The media style used for the converted PDF document. Please refer to values starting from FSDK.HTML2PDFSettingData.e_MediaStyleScreen and this should be one of these values.
  [in] | to_load_active_content | Whether to load active content or not.
  [in] | to_disable_sandbox | Whether to disable sandbox or not.
  [in] | to_use_blacklist | Whether to use blacklist or not.
  [in] | to_hide_header | Whether to hide header or not.
  [in] | to_hide_footer | Whether to hide footer or not.
  [in] | to_deny_local_file_access | Whether to deny local file access or not.

Returns
  None.

## Member Data Documentation

## ◆ _PageModeSinglePage

FSDK.HTML2PDFSettingData._PageModeSinglePage
| static

Enumeration for page mode used for converting HTML to PDF.

Values of this enumeration should be used alone.

Single page mode.

## ◆ e_EncodingFormatDefault

FSDK.HTML2PDFSettingData.e_EncodingFormatDefault
| static

Enumeration for encoding format used for converting HTML to PDF.

Values of this enumeration should be used alone.

Encoding foramt: Default.The encoding format will be automatically detected in chromium.

## ◆ e_MediaStyleScreen

FSDK.HTML2PDFSettingData.e_MediaStyleScreen
| static

Enumeration for media style used for converting HTML to PDF.

Values of this enumeration should be used alone.

Media style: screen. It means PDF page will be displayed in screen media style.

## ◆ e_ScalingModeNone

FSDK.HTML2PDFSettingData.e_ScalingModeNone
| static

Enumeration for scaling mode used for converting HTML to PDF.

Values of this enumeration should be used alone.

Scaling mode: Fixed page with no scale. In this mode, the text size of HTML content will not be changed.

## ◆ is_to_page_scale

FSDK.HTML2PDFSettingData.is_to_page_scale

Used to decide whether to scale the converted PDF page or not.

Deprecated:
  Current property has been deprecated since Foxit PDF SDK 8.2. This property will not have any effect on converting PDF any more. For scaling mode, please refer to scaling_mode.

## ◆ page_height

FSDK.HTML2PDFSettingData.page_height

The page height used for the converted PDF document (unit is 1/72 inch).

This value minus the sum of the top and bottom margins must be bigger than 16.

Note
  The page height would be ignored if page mode FSDK.HTML2PDFSettingData.e_PageModeSinglePage is used.

## ◆ page_margin

FSDK.HTML2PDFSettingData.page_margin

The page margin used for converted PDF document.

Note
  This value does not represent a rectangle. It just defines the left margin, bottom margin, right margin and top margin of a PDF page.

## ◆ page_width

FSDK.HTML2PDFSettingData.page_width

The page width used for the converted PDF document (unit is 1/72 inch).

This value minus the sum of the left and right margins must be bigger than 16.

## ◆ to_deny_local_file_access

FSDK.HTML2PDFSettingData.to_deny_local_file_access

Used to decide whether to deny local file access or not during converting html file.

true means that prevents the HTML file from accessing any local files outside of its own directory. false means that allows the HTML file to access to any local file paths. Default value: false.

## ◆ to_disable_sandbox

FSDK.HTML2PDFSettingData.to_disable_sandbox

Used to decide whether to disable sandbox or not.

true means to disable sandbox, and false means not. Default: true.

## ◆ to_load_active_content

FSDK.HTML2PDFSettingData.to_load_active_content

Used to decide whether to load active content or not.

This parameter is useful for some optimized web pages. These web page will not load the entire content. When the user scrolls down the page, the contents of the web page will be loaded when they are displayed on the user screen. true means to load the active content that has not been loaded by the web page, and false means not. Default:false.

## ◆ to_use_blacklist

FSDK.HTML2PDFSettingData.to_use_blacklist

Used to decide whether to use blacklist or not.

This parameter is useful for checking all accessed URLs during the HTML to the PDF conversion process.
During the conversion of specific URL, there could be many third-party websites that are accessed by the conversion process (images, CSS styles, requests from JavaScripts, and others).
All of these accesses will be checked against the blacklist record. There is a prepared switch that enables the blacklist functionality in the converter. true means to use the blacklist, and false means not. Default: false. Blacklist JSON is located next to the fxhtml2pdf application and its name must be "blacklist.json".It consist from three parts of records:

- list of domains.
- list of IPs.
- list of IP ranges.

"blacklist.json" Examples:

             {"Domains":[
                  "xxx.com",
                  "xxx.com"
                  ]
              ,
             "IPs":["1.2.3.4","5.6.7.8"]
             ,
             "IPsegments":[{"16":["104.193.88.0","104.193.88.100"]},{"16":["20.0.0.1","20.0.0.10"]}]
             }