Foxit PDF SDK

Instance Methods | Properties | List of all members
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:to_hide_header:to_hide_footer:to_deny_local_file_access:
| 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:to_hide_header:to_hide_footer:to_deny_local_file_access:
| 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...
FSRectF * | page_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_deny_local_file_access
| Used to decide whether to deny local file access or not during converting html file. It can not support on Linux x86 platform. More...
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_hide_footer
| Used to decide whether to hide footer or not. It can not support on Linux x86 platform.
BOOL | to_hide_header
| Used to decide whether to hide header or not. It can not support on Linux x86 platform.
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:to_hide_header:to_hide_footer:to_deny_local_file_access:()

- (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
to_hide_header: |  | (BOOL) | to_hide_header
to_hide_footer: |  | (BOOL) | to_hide_footer
to_deny_local_file_access: |  | (BOOL) | to_deny_local_file_access

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 FSHTML2PDFSettingDataPageModeSinglePage 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 FSRotation0 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 FSHTML2PDFSettingDataPageModeSinglePage 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 FSHTML2PDFSettingDataScalingModeNone and this should be one of these values. Default value:FSHTML2PDFSettingDataScalingModeScale.
  [in] | encoding_format | The HTML encoding format Please refer to values starting from 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 FSHTML2PDFSettingDataMediaStyleScreen 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: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:to_deny_local_file_access:()

- (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
to_hide_header: |  | (BOOL) | to_hide_header
to_hide_footer: |  | (BOOL) | to_hide_footer
to_deny_local_file_access: |  | (BOOL) | to_deny_local_file_access

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 FSHTML2PDFSettingDataPageModeSinglePage 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 FSRotation0 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 FSHTML2PDFSettingDataPageModeSinglePage 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 FSHTML2PDFSettingDataScalingModeNone and this should be one of these values.Default value:.
  [in] | encoding_format | The HTML encoding format Please refer to values starting from 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 FSHTML2PDFSettingDataMediaStyleScreen 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.

## Property Documentation

## ◆ is_to_page_scale

- (BOOL) is_to_page_scale
| read write nonatomic assign

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
| read write nonatomic assign

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
| read write nonatomic weak

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
| read write nonatomic assign

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

- (BOOL) to_deny_local_file_access
| read write nonatomic assign

Used to decide whether to deny local file access or not during converting html file. It can not support on Linux x86 platform.

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

## ◆ to_disable_sandbox

- (BOOL) to_disable_sandbox
| read write nonatomic assign

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
| read write nonatomic assign

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
| read write nonatomic assign

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"]}]
             }