Foxit PDF SDK
FSHTML2PDFSettingData Class Reference

Inherits NSObject.

Instance Methods

(id) - init
 Constructor.

 
(id) - initWithPage_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:
 Constructor, with parameters.
More...
 
(void) - set: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:
 Set value.
More...
 

Properties

NSString * bookmark_root_name
 The bookmark's root name.

 
FSHTML2PDFSettingDataHTML2PDFEncodingFormat encoding_format
 The HTML encoding format Please refer to values starting from FSHTML2PDFSettingDataEncodingFormatDefault and this should be one of these values.

 
NSString * headerfooter_title
 The header-footer title which is content for center header.

 
NSString * 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...
 
FSHTML2PDFSettingDataHTML2PDFMediaStyle media_style
 The media style used for the converted PDF document. Please refer to values starting from FSHTML2PDFSettingDataMediaStyleScreen and this should be one of these values.

 
float page_height
 The page height used for the converted PDF document (unit is 1/72 inch).
More...
 
FSRectFpage_margin
 The page margin used for converted PDF document.
More...
 
FSHTML2PDFSettingDataHTML2PDFPageMode page_mode
 The page mode used for the converting. Please refer to values starting from FSHTML2PDFSettingDataPageModeSinglePage and this should be one of these values.

 
float page_width
 The page width used for the converted PDF document (unit is 1/72 inch).
More...
 
FSRotation rotate_degrees
 The rotation degree used for the converted PDF page.Please refer to values starting from FSRotation0 and this should be one of these values.

 
FSHTML2PDFSettingDataHTML2PDFScalingMode scaling_mode
 The scaling mode used for the converted PDF document. Please refer to values starting from FSHTML2PDFSettingDataScalingModeNone and this should be one of these values.

 
BOOL to_disable_sandbox
 Used to decide whether to disable sandbox or not.
More...
 
BOOL to_generate_bookmarks
 Used to decide whether bookmarks should be generated or not.

 
BOOL to_load_active_content
 Used to decide whether to load active content or not.
More...
 
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.

 
BOOL to_use_blacklist
 Used to decide whether to use blacklist or not.
More...
 

Detailed Description

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

Method Documentation

◆ initWithPage_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:()

- (id) initWithPage_width: (float)  page_width
page_height: (float)  page_height
is_to_page_scale: (BOOL)  is_to_page_scale
page_margin: (FSRectF*)  page_margin
is_convert_link: (BOOL)  is_convert_link
rotate_degrees: (FSRotation rotate_degrees
is_generate_tag: (BOOL)  is_generate_tag
page_mode: (FSHTML2PDFSettingDataHTML2PDFPageMode page_mode
to_generate_bookmarks: (BOOL)  to_generate_bookmarks
scaling_mode: (FSHTML2PDFSettingDataHTML2PDFScalingMode scaling_mode
encoding_format: (FSHTML2PDFSettingDataHTML2PDFEncodingFormat encoding_format
to_render_images: (BOOL)  to_render_images
to_remove_underline_for_link: (BOOL)  to_remove_underline_for_link
to_set_headerfooter: (BOOL)  to_set_headerfooter
headerfooter_title: (NSString *)  headerfooter_title
headerfooter_url: (NSString *)  headerfooter_url
bookmark_root_name: (NSString *)  bookmark_root_name
to_resize_objects: (BOOL)  to_resize_objects
to_print_background: (BOOL)  to_print_background
to_optimize_tag_tree: (BOOL)  to_optimize_tag_tree
media_style: (FSHTML2PDFSettingDataHTML2PDFMediaStyle media_style
to_load_active_content: (BOOL)  to_load_active_content
to_disable_sandbox: (BOOL)  to_disable_sandbox
to_use_blacklist: (BOOL)  to_use_blacklist 

Constructor, with parameters.

Parameters
[in]page_widthThe page width used for the converted PDF document (unit is 1/72 inch).
[in]page_heightThe page height used for the converted PDF document (unit is 1/72 inch). This would be ignored if page mode FSHTML2PDFSettingDataPageModeSinglePage 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 FSRotation0 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 FSHTML2PDFSettingDataPageModeSinglePage 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 FSHTML2PDFSettingDataScalingModeNone and this should be one of these values.
[in]encoding_formatThe HTML encoding format Please refer to values starting from 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 FSHTML2PDFSettingDataMediaStyleScreen and this should be one of these values.
[in]to_load_active_contentWhether to load active content or not.
[in]to_disable_sandboxWhether to disable sandbox or not.
[in]to_use_blacklistWhether to use blacklist or not.
Returns
None.

◆ set: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:()

- (void) set: (float)  page_width
page_height: (float)  page_height
is_to_page_scale: (BOOL)  is_to_page_scale
page_margin: (FSRectF*)  page_margin
is_convert_link: (BOOL)  is_convert_link
rotate_degrees: (FSRotation rotate_degrees
is_generate_tag: (BOOL)  is_generate_tag
page_mode: (FSHTML2PDFSettingDataHTML2PDFPageMode page_mode
to_generate_bookmarks: (BOOL)  to_generate_bookmarks
scaling_mode: (FSHTML2PDFSettingDataHTML2PDFScalingMode scaling_mode
encoding_format: (FSHTML2PDFSettingDataHTML2PDFEncodingFormat encoding_format
to_render_images: (BOOL)  to_render_images
to_remove_underline_for_link: (BOOL)  to_remove_underline_for_link
to_set_headerfooter: (BOOL)  to_set_headerfooter
headerfooter_title: (NSString *)  headerfooter_title
headerfooter_url: (NSString *)  headerfooter_url
bookmark_root_name: (NSString *)  bookmark_root_name
to_resize_objects: (BOOL)  to_resize_objects
to_print_background: (BOOL)  to_print_background
to_optimize_tag_tree: (BOOL)  to_optimize_tag_tree
media_style: (FSHTML2PDFSettingDataHTML2PDFMediaStyle media_style
to_load_active_content: (BOOL)  to_load_active_content
to_disable_sandbox: (BOOL)  to_disable_sandbox
to_use_blacklist: (BOOL)  to_use_blacklist 

Set value.

Parameters
[in]page_widthThe page width used for the converted PDF document (unit is 1/72 inch).
[in]page_heightThe page height used for the converted PDF document (unit is 1/72 inch). This would be ignored if page mode FSHTML2PDFSettingDataPageModeSinglePage 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 FSRotation0 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 FSHTML2PDFSettingDataPageModeSinglePage 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 FSHTML2PDFSettingDataScalingModeNone and this should be one of these values.
[in]encoding_formatThe HTML encoding format Please refer to values starting from 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 FSHTML2PDFSettingDataMediaStyleScreen and this should be one of these values.
[in]to_load_active_contentWhether to load active content or not.
[in]to_disable_sandboxWhether to disable sandbox or not.
[in]to_use_blacklistWhether to use blacklist or not.
Returns
None.

Property Documentation

◆ is_to_page_scale

- (BOOL) is_to_page_scale
readwritenonatomicassign

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) page_height
readwritenonatomicassign

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 FSHTML2PDFSettingDataPageModeSinglePage is used.

◆ page_margin

- (FSRectF *) page_margin
readwritenonatomicweak

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) page_width
readwritenonatomicassign

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_disable_sandbox

- (BOOL) to_disable_sandbox
readwritenonatomicassign

Used to decide whether to disable sandbox or not.

YES means to disable sandbox, and NO means not. Default: YES.

◆ to_load_active_content

- (BOOL) to_load_active_content
readwritenonatomicassign

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. YES means to load the active content that has not been loaded by the web page, and NO means not. Default:NO.

◆ to_use_blacklist

- (BOOL) to_use_blacklist
readwritenonatomicassign

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. YES means to use the blacklist, and NO means not. Default: NO. 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"]}]
         }