Foxit PDF SDK
foxit::addon::conversion::HTML2PDFSettingData Class Reference

Inherits Object.

Public Types

enum  HTML2PDFEncodingFormat {
  e_EncodingFormatDefault = 0, e_EncodingFormatASCII = 1, e_EncodingFormatLatin2 = 2, e_EncodingFormatLatin3 = 3,
  e_EncodingFormatLatin4 = 4, e_EncodingFormatLatin5 = 5, e_EncodingFormatLatin6 = 6, e_EncodingFormatISO_8859_5 = 7,
  e_EncodingFormatArabic = 8, e_EncodingFormatGreek = 9, e_EncodingFormatHebrew = 10, e_EncodingFormatEUC_JP = 11,
  e_EncodingFormatSJS = 12, e_EncodingFormatJIS = 13, e_EncodingFormatBIG5 = 14, e_EncodingFormatGB = 15,
  e_EncodingFormatEUC_CN = 16, e_EncodingFormatKSC = 17, e_EncodingFormatUnicode = 18, e_EncodingFormatEUC = 19,
  e_EncodingFormatCNS = 20, e_EncodingFormatBIG5_CP950 = 21, e_EncodingFormatASCII_7_bit = 22, e_EncodingFormatKOI8R = 23,
  e_EncodingFormatCP852 = 24, e_EncodingFormatCP866 = 25, e_EncodingFormatCP874 = 26, e_EncodingFormatCP932 = 27,
  e_EncodingFormatCP1250 = 28, e_EncodingFormatCP1251 = 29, e_EncodingFormatCP1252 = 30, e_EncodingFormatCP1253 = 31,
  e_EncodingFormatCP1254 = 32, e_EncodingFormatCP1255 = 33, e_EncodingFormatCP1256 = 34, e_EncodingFormatCP1257 = 35,
  e_EncodingFormatKOI8U = 36, e_EncodingFormatISO_8859_15 = 37, e_EncodingFormatISO_8859_11 = 38, e_EncodingFormatISO_8859_8_I = 39,
  e_EncodingFormatVISUAL = 40, e_EncodingFormatCSN_369103 = 41, e_EncodingFormatISO_8859_13 = 42, e_EncodingFormatISO_2022_KR = 43,
  e_EncodingFormatGBK = 44, e_EncodingFormatGB18030 = 45, e_EncodingFormatBIG5_HKSCS = 46, e_EncodingFormatISO_2022_CN = 47,
  e_EncodingFormatTSCII = 48, e_EncodingFormatTAM = 49, e_EncodingFormatTAB = 50, e_EncodingFormatJAGRAN = 51,
  e_EncodingFormatMACINTOSH = 52, e_EncodingFormatUTF7 = 53, e_EncodingFormatBHASKAR = 54, e_EncodingFormatHTCHANAKYA = 55,
  e_EncodingFormatUTF_16BE = 56, e_EncodingFormatUTF_16LE = 57, e_EncodingFormatUTF_32BE = 58, e_EncodingFormatUTF_32LE = 59,
  e_EncodingFormatX_BINARYENC = 60, e_EncodingFormatHZ_GB_2312 = 61, e_EncodingFormatX_UTF8UTF8 = 62, e_EncodingFormatX_TAM_ELANGO = 63,
  e_EncodingFormatX_TAM_LTTMBARANI = 64, e_EncodingFormatX_TAM_SHREE = 65, e_EncodingFormatX_TAM_TBOOMIS = 66, e_EncodingFormatX_TAM_TMNEWS = 67,
  e_EncodingFormatX_TAM_WEBTAMIL = 68, e_EncodingFormatX_KDDI_Shift_JIS = 69, e_EncodingFormatX_DoCoMo_Shift_JIS = 70, e_EncodingFormatX_SoftBank_Shift_JIS = 71,
  e_EncodingFormatX_KDDI_ISO_2022_JP = 72, e_EncodingFormatX_SoftBank_ISO_2022_JP = 73
}
 Enumeration for encoding format used for converting HTML to PDF. More...
 
enum  HTML2PDFMediaStyle { e_MediaStyleScreen = 0, e_MediaStylePrint = 1 }
 Enumeration for media style used for converting HTML to PDF. More...
 
enum  HTML2PDFPageMode { e_PageModeSinglePage = 0, e_PageModeMultiplePage = 1 }
 Enumeration for page mode used for converting HTML to PDF. More...
 
enum  HTML2PDFScalingMode { e_ScalingModeNone = 0, e_ScalingModeScale = 1, e_ScalingModeEnlarge = 2 }
 Enumeration for scaling mode used for converting HTML to PDF. More...
 

Public Member Functions

 HTML2PDFSettingData ()
 Constructor.
 
 HTML2PDFSettingData (float page_width, float page_height, bool is_to_page_scale, RectF page_margin, bool is_convert_link, common::Rotation rotate_degrees, bool is_generate_tag, HTML2PDFPageMode page_mode, bool to_generate_bookmarks, HTML2PDFScalingMode scaling_mode, HTML2PDFEncodingFormat encoding_format, bool to_render_images, bool to_remove_underline_for_link, bool to_set_headerfooter, const wchar_t *headerfooter_title, const wchar_t *headerfooter_url, const wchar_t *bookmark_root_name, bool to_resize_objects, bool to_print_background, bool to_optimize_tag_tree, HTML2PDFMediaStyle media_style)
 Constructor, with parameters. More...
 
HTML2PDFSettingDataoperator= (const HTML2PDFSettingData &data)
 Assign operator. More...
 
void Set (float page_width, float page_height, bool is_to_page_scale, RectF page_margin, bool is_convert_link, common::Rotation rotate_degrees, bool is_generate_tag, HTML2PDFPageMode page_mode, bool to_generate_bookmarks, HTML2PDFScalingMode scaling_mode, HTML2PDFEncodingFormat encoding_format, bool to_render_images, bool to_remove_underline_for_link, bool to_set_headerfooter, const wchar_t *headerfooter_title, const wchar_t *headerfooter_url, const wchar_t *bookmark_root_name, bool to_resize_objects, bool to_print_background, bool to_optimize_tag_tree, HTML2PDFMediaStyle media_style)
 Set value. More...
 

Public Attributes

foxit::WString bookmark_root_name
 The bookmark's root name.
 
HTML2PDFEncodingFormat encoding_format
 The HTML encoding format Please refer to values starting from HTML2PDFEncodingFormat::e_EncodingFormatDefault and this should be one of these values.
 
foxit::WString headerfooter_title
 The header-footer title which is content for center header.
 
foxit::WString headerfooter_url
 The header-footer url which is content for left footer.
 
bool is_convert_link
 Used to decide whether the web link should be converted or not.
 
bool is_generate_tag
 Used to decide whether the tag should be generated or not.
 
bool is_to_page_scale
 Used to decide whether to scale the converted PDF page or not. More...
 
HTML2PDFMediaStyle media_style
 The media style used for the converted PDF document. Please refer to values starting from HTML2PDFSettingData::e_MediaStyleScreen and this should be one of these values.
 
float page_height
 The page height used for the converted PDF document. More...
 
RectF page_margin
 The page margin used for converted PDF document. More...
 
HTML2PDFPageMode page_mode
 The page mode used for the converting. Please refer to values starting from HTML2PDFSettingData::e_PageModeSinglePage and this should be one of these values.
 
float page_width
 The page width used for the converted PDF document. More...
 
common::Rotation rotate_degrees
 The rotation degree used for the converted PDF page.Please refer to values starting from common::e_Rotation0 and this should be one of these values.
 
HTML2PDFScalingMode scaling_mode
 The scaling mode used for the converted PDF document. Please refer to values starting from HTML2PDFSettingData::e_ScalingModeNone and this should be one of these values.
 
bool to_generate_bookmarks
 Used to decide whether bookmarks should be generated or not.
 
bool to_optimize_tag_tree
 Used to decide whether to optimize tag tree or not.
 
bool to_print_background
 Used to decide whether to print background or not.
 
bool to_remove_underline_for_link
 Used to decide whether to remove underline decoration for link.
 
bool to_render_images
 Used to decide whether to render images or not.
 
bool to_resize_objects
 Whether to enable the Javascripts related resizing of the objects during rendering process.
 
bool to_set_headerfooter
 Used to decide whether to set header-footer or not.
 

Detailed Description

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

Member Enumeration Documentation

◆ HTML2PDFEncodingFormat

Enumeration for encoding format used for converting HTML to PDF.

Values of this enumeration should be used alone.

Enumerator
e_EncodingFormatDefault 

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

e_EncodingFormatASCII 

Encoding foramt: "ASCII".

e_EncodingFormatLatin2 

Encoding foramt: "Latin2".

e_EncodingFormatLatin3 

Encoding foramt: "Latin3".

e_EncodingFormatLatin4 

Encoding foramt: "Latin4".

e_EncodingFormatLatin5 

Encoding foramt: "Latin5".

e_EncodingFormatLatin6 

Encoding foramt: "Latin6".

e_EncodingFormatISO_8859_5 

Encoding foramt: "ISO-8859-5".

e_EncodingFormatArabic 

Encoding foramt: "Arabic".

e_EncodingFormatGreek 

Encoding foramt: "Greek".

e_EncodingFormatHebrew 

Encoding foramt: "Hebrew".

e_EncodingFormatEUC_JP 

Encoding foramt: "EUC-JP".

e_EncodingFormatSJS 

Encoding foramt: "SJS".

e_EncodingFormatJIS 

Encoding foramt: "JIS".

e_EncodingFormatBIG5 

Encoding foramt: "BIG5".

e_EncodingFormatGB 

Encoding foramt: "GB".

e_EncodingFormatEUC_CN 

Encoding foramt: "EUC-CN".

e_EncodingFormatKSC 

Encoding foramt: "KSC".

e_EncodingFormatUnicode 

Encoding foramt: "Unicode".

e_EncodingFormatEUC 

Encoding foramt: "EUC".

e_EncodingFormatCNS 

Encoding foramt: "CNS".

e_EncodingFormatBIG5_CP950 

Encoding foramt: "BIG5-CP950".

e_EncodingFormatASCII_7_bit 

Encoding foramt: "ASCII-7-bit".

e_EncodingFormatKOI8R 

Encoding foramt: "KOI8R".

e_EncodingFormatCP852 

Encoding foramt: "CP852".

e_EncodingFormatCP866 

Encoding foramt: "CP866".

e_EncodingFormatCP874 

Encoding foramt: "CP874".

e_EncodingFormatCP932 

Encoding foramt: "CP932".

e_EncodingFormatCP1250 

Encoding foramt: "CP1250".

e_EncodingFormatCP1251 

Encoding foramt: "CP1251".

e_EncodingFormatCP1252 

Encoding foramt: "CP1252".

e_EncodingFormatCP1253 

Encoding foramt: "CP1253".

e_EncodingFormatCP1254 

Encoding foramt: "CP1254".

e_EncodingFormatCP1255 

Encoding foramt: "CP1255".

e_EncodingFormatCP1256 

Encoding foramt: "CP1256".

e_EncodingFormatCP1257 

Encoding foramt: "CP1257".

e_EncodingFormatKOI8U 

Encoding foramt: "KOI8U".

e_EncodingFormatISO_8859_15 

Encoding foramt: "ISO-8859-15".

e_EncodingFormatISO_8859_11 

Encoding foramt: "ISO-8859-11".

e_EncodingFormatISO_8859_8_I 

Encoding foramt: "ISO-8859-8-I".

e_EncodingFormatVISUAL 

Encoding foramt: "VISUAL".

e_EncodingFormatCSN_369103 

Encoding foramt: "CSN_369103".

e_EncodingFormatISO_8859_13 

Encoding foramt: "ISO-8859-13".

e_EncodingFormatISO_2022_KR 

Encoding foramt: "ISO-2022-KR".

e_EncodingFormatGBK 

Encoding foramt: "GBK".

e_EncodingFormatGB18030 

Encoding foramt: "GB18030".

e_EncodingFormatBIG5_HKSCS 

Encoding foramt: "BIG5_HKSCS".

e_EncodingFormatISO_2022_CN 

Encoding foramt: "ISO_2022_CN".

e_EncodingFormatTSCII 

Encoding foramt: "TSCII".

e_EncodingFormatTAM 

Encoding foramt: "TAM".

e_EncodingFormatTAB 

Encoding foramt: "TAB".

e_EncodingFormatJAGRAN 

Encoding foramt: "JAGRAN".

e_EncodingFormatMACINTOSH 

Encoding foramt: "MACINTOSH".

e_EncodingFormatUTF7 

Encoding foramt: "UTF7".

e_EncodingFormatBHASKAR 

Encoding foramt: "BHASKAR".

e_EncodingFormatHTCHANAKYA 

Encoding foramt: "HTCHANAKYA".

e_EncodingFormatUTF_16BE 

Encoding foramt: "UTF-16BE".

e_EncodingFormatUTF_16LE 

Encoding foramt: "UTF-16LE".

e_EncodingFormatUTF_32BE 

Encoding foramt: "UTF-32BE".

e_EncodingFormatUTF_32LE 

Encoding foramt: "UTF-32LE".

e_EncodingFormatX_BINARYENC 

Encoding foramt: "X-BINARYENC".

e_EncodingFormatHZ_GB_2312 

Encoding foramt: "HZ-GB-2312".

e_EncodingFormatX_UTF8UTF8 

Encoding foramt: "X-UTF8UTF8".

e_EncodingFormatX_TAM_ELANGO 

Encoding foramt: "X-TAM-ELANGO".

e_EncodingFormatX_TAM_LTTMBARANI 

Encoding foramt: "X-TAM-LTTMBARANI".

e_EncodingFormatX_TAM_SHREE 

Encoding foramt: "X-TAM-SHREE".

e_EncodingFormatX_TAM_TBOOMIS 

Encoding foramt: "X-TAM-TBOOMIS".

e_EncodingFormatX_TAM_TMNEWS 

Encoding foramt: "X-TAM-TMNEWS".

e_EncodingFormatX_TAM_WEBTAMIL 

Encoding foramt: "X-TAM-WEBTAMIL".

e_EncodingFormatX_KDDI_Shift_JIS 

Encoding foramt: "X-KDDI-Shift_JIS".

e_EncodingFormatX_DoCoMo_Shift_JIS 

Encoding foramt: "X-DoCoMo-Shift_JIS".

e_EncodingFormatX_SoftBank_Shift_JIS 

Encoding foramt: "X-SoftBank-Shift_JIS".

e_EncodingFormatX_KDDI_ISO_2022_JP 

Encoding foramt: "X-KDDI-ISO-2022-JP".

e_EncodingFormatX_SoftBank_ISO_2022_JP 

Encoding foramt: "X-SoftBank-ISO-2022-JP".

◆ HTML2PDFMediaStyle

Enumeration for media style used for converting HTML to PDF.

Values of this enumeration should be used alone.

Enumerator
e_MediaStyleScreen 

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

e_MediaStylePrint 

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

◆ HTML2PDFPageMode

Enumeration for page mode used for converting HTML to PDF.

Values of this enumeration should be used alone.

Enumerator
e_PageModeSinglePage 

Single page mode.

e_PageModeMultiplePage 

Multiple page mode.

◆ HTML2PDFScalingMode

Enumeration for scaling mode used for converting HTML to PDF.

Values of this enumeration should be used alone.

Enumerator
e_ScalingModeNone 

Scaling mode: Fixed page with no scale.

e_ScalingModeScale 

Page scaling: Scale. It means HTML content will be scaled to fit PDF page size.

e_ScalingModeEnlarge 

Page scaling: Enlarge. It means PDF page will be enlarged to HTML content size.

Constructor & Destructor Documentation

◆ HTML2PDFSettingData()

foxit::addon::conversion::HTML2PDFSettingData::HTML2PDFSettingData ( float  page_width,
float  page_height,
bool  is_to_page_scale,
RectF  page_margin,
bool  is_convert_link,
common::Rotation  rotate_degrees,
bool  is_generate_tag,
HTML2PDFPageMode  page_mode,
bool  to_generate_bookmarks,
HTML2PDFScalingMode  scaling_mode,
HTML2PDFEncodingFormat  encoding_format,
bool  to_render_images,
bool  to_remove_underline_for_link,
bool  to_set_headerfooter,
const wchar_t *  headerfooter_title,
const wchar_t *  headerfooter_url,
const wchar_t *  bookmark_root_name,
bool  to_resize_objects,
bool  to_print_background,
bool  to_optimize_tag_tree,
HTML2PDFMediaStyle  media_style 
)
inline

Constructor, with parameters.

Parameters
[in]page_widthThe page width used for the converted PDF document.
[in]page_heightThe page height used for the converted PDF document. This would be ignored if page mode 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_marginThe page margin used for converted PDF document.
[in]is_convert_linkUsed to decide whether the web link should be converted or not.
[in]rotate_degreesThe rotation degree used for the converted PDF page.Please refer to values starting from common::e_Rotation0 and this should be one of these values.
[in]is_generate_tagUsed to decide whether the tag should be generated or not.
[in]page_modeThe page mode used for the converting. Please refer to values starting from HTML2PDFSettingData::e_PageModeSinglePage and this should be one of these values.
[in]to_generate_bookmarksUsed to decide whether bookmarks should be generated or not.
[in]scaling_modeThe scaling mode used for the converted PDF document. Please refer to values starting from HTML2PDFSettingData::e_ScalingModeNone and this should be one of these values. Default value:HTML2PDFSettingData::e_ScalingModeScale.
[in]encoding_formatThe HTML encoding format Please refer to values starting from HTML2PDFEncodingFormat::e_EncodingFormatDefault and this should be one of these values.
[in]to_render_imagesWhether to render images or not.
[in]to_remove_underline_for_linkWhether to remove underline decoration for link or not.
[in]to_set_headerfooterWhether to set header-footer or not.
[in]headerfooter_titleThe header-footer title which is content for center header.
[in]headerfooter_urlThe header-footer url which is content for left footer.
[in]bookmark_root_nameThe bookmark's root name.
[in]to_resize_objectsWhether to enable the Javascripts related resizing of the objects during rendering process.
[in]to_print_backgroundWhether to print background or not.
[in]to_optimize_tag_treeWhether to optimize tag tree or not.
[in]media_styleThe media style used for the converted PDF document. Please refer to values starting from HTML2PDFSettingData::e_MediaStyleScreen and this should be one of these values.
Returns
None.

Member Function Documentation

◆ operator=()

HTML2PDFSettingData& foxit::addon::conversion::HTML2PDFSettingData::operator= ( const HTML2PDFSettingData data)
inline

Assign operator.

Parameters
[in]dataAnother HTML-to-PDF setting data object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ Set()

void foxit::addon::conversion::HTML2PDFSettingData::Set ( float  page_width,
float  page_height,
bool  is_to_page_scale,
RectF  page_margin,
bool  is_convert_link,
common::Rotation  rotate_degrees,
bool  is_generate_tag,
HTML2PDFPageMode  page_mode,
bool  to_generate_bookmarks,
HTML2PDFScalingMode  scaling_mode,
HTML2PDFEncodingFormat  encoding_format,
bool  to_render_images,
bool  to_remove_underline_for_link,
bool  to_set_headerfooter,
const wchar_t *  headerfooter_title,
const wchar_t *  headerfooter_url,
const wchar_t *  bookmark_root_name,
bool  to_resize_objects,
bool  to_print_background,
bool  to_optimize_tag_tree,
HTML2PDFMediaStyle  media_style 
)
inline

Set value.

Parameters
[in]page_widthThe page width used for the converted PDF document.
[in]page_heightThe page height used for the converted PDF document. This would be ignored if page mode 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_marginThe page margin used for converted PDF document.
[in]is_convert_linkUsed to decide whether the web link should be converted or not.
[in]rotate_degreesThe rotation degree used for the converted PDF page.Please refer to values starting from common::e_Rotation0 and this should be one of these values.
[in]is_generate_tagUsed to decide whether the tag should be generated or not.
[in]page_modeThe page mode used for the converting. Please refer to values starting from HTML2PDFSettingData::e_PageModeSinglePage and this should be one of these values.
[in]to_generate_bookmarksUsed to decide whether bookmarks should be generated or not.
[in]scaling_modeThe scaling mode used for the converted PDF document. Please refer to values starting from HTML2PDFSettingData::e_ScalingModeNone and this should be one of these values.Default value:HTML2PDFSettingData::e_PageScalingScale.
[in]encoding_formatThe HTML encoding format Please refer to values starting from HTML2PDFEncodingFormat::e_EncodingFormatDefault and this should be one of these values.
[in]to_render_imagesWhether to render images or not.
[in]to_remove_underline_for_linkWhether to remove underline decoration for link or not.
[in]to_set_headerfooterWhether to set header-footer or not.
[in]headerfooter_titleThe header-footer title which is content for center header.
[in]headerfooter_urlThe header-footer url which is content for left footer.
[in]bookmark_root_nameThe bookmark's root name.
[in]to_resize_objectsWhether to enable the Javascripts related resizing of the objects during rendering process.
[in]to_print_backgroundWhether to print background or not.
[in]to_optimize_tag_treeWhether to optimize tag tree or not.
[in]media_styleThe media style used for the converted PDF document. Please refer to values starting from HTML2PDFSettingData::e_MediaStyleScreen and this should be one of these values.
Returns
None.

Member Data Documentation

◆ is_to_page_scale

bool foxit::addon::conversion::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

float foxit::addon::conversion::HTML2PDFSettingData::page_height

The page height used for the converted PDF document.

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 HTML2PDFSettingData::e_PageModeSinglePage is used.

◆ page_margin

RectF foxit::addon::conversion::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

float foxit::addon::conversion::HTML2PDFSettingData::page_width

The page width used for the converted PDF document.

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