Foxit PDF SDK

Class Methods | List of all members
FSConvert Class Reference
Inheritance diagram for FSConvert:

## Class Methods
(BOOL) | + fromDWG:src_dwg_path:saved_pdf_path:settings:
| Convert a DWG format file to a PDF file. More...
(void) | + fromHTML:engine_path:cookies_path:setting_data:saved_pdf_path:timeout:
| Convert a HTML format file or a URL of a Web page to a PDF file. More...
(void) | + fromHTMLWithReaderCallback:engine_path:cookies_reader:setting_data:saved_pdf_path:timeout:
| Convert a HTML format file or a URL of a Web page to a PDF file. More...
(void) | + fromHTMLWithReaderCallbackHTML:html2pdf_related_resource_array:engine_path:cookies_reader:setting_data:saved_pdf_filestream:timeout:
| Convert a HTML format file or a URL of a Web page to a PDF file. More...
(void) | + fromHTMLWithSaveFileWriterCallback:engine_path:cookies_reader:setting_data:saved_pdf_filestream:timeout:
| Convert a HTML format file or a URL of a Web page to a PDF file. More...
(void) | + fromImage:saved_pdf_path:
| Convert a Image format file to a PDF file. More...
(void) | + fromImageWithStreamCallback:saved_pdf_filestream:
| Convert a Image format file to a PDF file. More...
(void) | + fromTXT:saved_pdf_path:setting_data:
| Convert a TXT format file to a PDF file. More...
(BOOL) | + toXML:src_file_password:saved_xml_path:saved_image_folder_path:is_force_to_tagged_pdf:
| Convert a PDF file to a XML format file. More...

## Detailed Description

Conversion add-on module can be used to do some conversion between PDF file and other file formats. Before using any class or methods in this module, please ensure Foxit PDF SDK has been initialized successfully by function FSLibrary::initialize:key: with a key including "Conversion" module. Before using function FSConvert::fromDWG:src_dwg_path:saved_pdf_path:settings:, please ensure Foxit PDF SDK has been initialized successfully by function FSLibrary::initialize:key: with a key including "DWG2PDF" module. From version 11.0, we do not update and maintance HTML2PDF engine package on linux x86 platform and maybe it will be deprecated in the future version on linux x86 platform.

See also
  FSLibrary

## Method Documentation

## ◆ fromDWG:src_dwg_path:saved_pdf_path:settings:()

+ (BOOL) fromDWG: |  | (NSString *) | engine_path
src_dwg_path: |  | (NSString *) | src_dwg_path
saved_pdf_path: |  | (NSString *) | saved_pdf_path
settings: |  | (FSDWG2PDFSettingData*) | settings

Convert a DWG format file to a PDF file.

Currently, this function can only be used for desktop platforms; for other platform, this function will return NO directly without doing anything.

Parameters

  [in] | engine_path | The directory path of "DWG to PDF" engine. This should not be an empty string.
  [in] | src_dwg_path | A DWG or DXF format file path. This should not be an empty string.
  [in] | saved_pdf_path | A path for saving the converted PDF file. This should not be an empty string.
  [in] | settings | The FSDWG2PDFSettingData object used for converting.

Returns
  None.

## ◆ fromHTML:engine_path:cookies_path:setting_data:saved_pdf_path:timeout:()

+ (void) fromHTML: |  | (NSString *) | src_html
engine_path: |  | (NSString *) | engine_path
cookies_path: |  | (NSString *) | cookies_path
setting_data: |  | (FSHTML2PDFSettingData*) | setting_data
saved_pdf_path: |  | (NSString *) | saved_pdf_path
timeout: |  | (int) | timeout

Convert a HTML format file or a URL of a Web page to a PDF file.

Currently, this function can only be used for desktop platforms; for other platform, this function will return directly without doing anything.

Parameters

  [in] | src_html | A URL of Web page or a HTML format file path. This should not be an empty string.
  [in] | engine_path | The directory path of "HTML to PDF" engine. This should not be an empty string.
  [in] | cookies_path | Path of cookies file. If this is an empty string, that means no cookie file is used. Data format is strongly recommended to use JSON format.
  [in] | setting_data | Setting data used for converting.
  [in] | saved_pdf_path | A path for saving the converted PDF file. This should not be an empty string.
  [in] | timeout | Seconds for timeout used for loading web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.

Returns
  None.

## ◆ fromHTMLWithReaderCallback:engine_path:cookies_reader:setting_data:saved_pdf_path:timeout:()

+ (void) fromHTMLWithReaderCallback: |  | (NSString *) | src_html
engine_path: |  | (NSString *) | engine_path
cookies_reader: |  | (id<FSFileReaderCallback>) | cookies_reader
setting_data: |  | (FSHTML2PDFSettingData*) | setting_data
saved_pdf_path: |  | (NSString *) | saved_pdf_path
timeout: |  | (int) | timeout

Convert a HTML format file or a URL of a Web page to a PDF file.

Currently, this function can only be used for desktop platforms; for other platform, this function will return directly without doing anything.

Parameters

  [in] | src_html | A URL of Web page or a HTML format file path. This should not be an empty string.
  [in] | engine_path | The directory path of "HTML to PDF" engine. This should not be an empty string.
  [in] | cookies_reader | A FSFileReaderCallback object which is implemented by user to pass cookies data to Foxit PDF SDK. If this is nil, that means no cookie data is used. Data format is strongly recommended to use JSON format.
  [in] | setting_data | Setting data used for converting.
  [in] | saved_pdf_path | A path for saving the converted PDF file. This should not be an empty string.
  [in] | timeout | Seconds for timeout used for loading web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.

Returns
  None.

## ◆ fromHTMLWithReaderCallbackHTML:html2pdf_related_resource_array:engine_path:cookies_reader:setting_data:saved_pdf_filestream:timeout:()

+ (void) fromHTMLWithReaderCallbackHTML: |  | (id<FSFileReaderCallback>) | src_html
html2pdf_related_resource_array: |  | (FSHTML2PDFRelatedResourceArray*) | html2pdf_related_resource_array
engine_path: |  | (NSString *) | engine_path
cookies_reader: |  | (id<FSFileReaderCallback>) | cookies_reader
setting_data: |  | (FSHTML2PDFSettingData*) | setting_data
saved_pdf_filestream: |  | (id<FSFileWriterCallback>) | saved_pdf_filestream
timeout: |  | (int) | timeout

Convert a HTML format file or a URL of a Web page to a PDF file.

Currently, this function can only be used for desktop platforms and mac arm platforms; for other platform, this function will return directly without doing anything.

Parameters

  [in] | html2pdf_related_resource_array | The FSHTML2PDFRelatedResourceArray which is related to source HTML.
  [in] | engine_path | The directory path of "HTML to PDF" engine. This should not be an empty string.
  [in] | cookies_reader | (Reserved;Not supported yet)A FSFileReaderCallback object which is implemented by user to pass cookies data to Foxit PDF SDK. If this is nil, that means no cookie data is used. Data format is strongly recommended to use JSON format.
  [in] | setting_data | Setting data used for converting.
  [in] | saved_pdf_filestream | A FSFileWriterCallback object for saving the converted PDF file. This should not be nil.
  [in] | timeout | Seconds for timeout used for loading web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.

Returns
  None.

## ◆ fromHTMLWithSaveFileWriterCallback:engine_path:cookies_reader:setting_data:saved_pdf_filestream:timeout:()

+ (void) fromHTMLWithSaveFileWriterCallback: |  | (NSString *) | src_html
engine_path: |  | (NSString *) | engine_path
cookies_reader: |  | (id<FSFileReaderCallback>) | cookies_reader
setting_data: |  | (FSHTML2PDFSettingData*) | setting_data
saved_pdf_filestream: |  | (id<FSFileWriterCallback>) | saved_pdf_filestream
timeout: |  | (int) | timeout

Convert a HTML format file or a URL of a Web page to a PDF file.

Currently, this function can only be used for desktop platforms; for other platform, this function will return directly without doing anything.

Parameters

  [in] | src_html | A URL of Web page or a HTML format file path. This should not be an empty string.
  [in] | engine_path | The directory path of "HTML to PDF" engine. This should not be an empty string.
  [in] | cookies_reader | A FSFileReaderCallback object which is implemented by user to pass cookies data to Foxit PDF SDK. If this is nil, that means no cookie data is used. Data format is strongly recommended to use JSON format.
  [in] | setting_data | Setting data used for converting.
  [in] | saved_pdf_filestream | A FSFileWriterCallback object for saving the converted PDF file. This should not be nil.
  [in] | timeout | Seconds for timeout used for loading web pages. It should be set to a value greater than 15. If this is less than 15, 15 will be used by default.

Returns
  None.

## ◆ fromImage:saved_pdf_path:()

+ (void) fromImage: |  | (NSString *) | src_img
saved_pdf_path: |  | (NSString *) | saved_pdf_path

Convert a Image format file to a PDF file.

Parameters

  [in] | src_img | A image format file path. This should not be an empty string.
  [in] | saved_pdf_path | A path for saving the converted PDF file. This should not be an empty string.

Returns
  None.

## ◆ fromImageWithStreamCallback:saved_pdf_filestream:()

+ (void) fromImageWithStreamCallback: |  | (id<FSFileReaderCallback>) | file_reader
saved_pdf_filestream: |  | (id<FSFileWriterCallback>) | saved_pdf_filestream

Convert a Image format file to a PDF file.

Parameters

  [in] | file_reader | A FSFileReaderCallback object which is implemented by user to pass image data to Foxit PDF SDK. It must be valid.
  [in] | saved_pdf_filestream | A FSFileWriterCallback object for saving the converted PDF file. This should not be nil.

Returns
  None.

## ◆ fromTXT:saved_pdf_path:setting_data:()

+ (void) fromTXT: |  | (NSString *) | src_txt
saved_pdf_path: |  | (NSString *) | saved_pdf_path
setting_data: |  | (FSTXT2PDFSettingData*) | setting_data

Convert a TXT format file to a PDF file.

Parameters

  [in] | src_txt | A TXT format file path. This should not be an empty string.
  [in] | saved_pdf_path | A path for saving the converted PDF file. This should not be an empty string.
  [in] | setting_data | Setting data used for converting.

Returns
  None.

## ◆ toXML:src_file_password:saved_xml_path:saved_image_folder_path:is_force_to_tagged_pdf:()

+ (BOOL) toXML: |  | (NSString *) | src_pdf_path
src_file_password: |  | (NSString *) | src_file_password
saved_xml_path: |  | (NSString *) | saved_xml_path
saved_image_folder_path: |  | (NSString *) | saved_image_folder_path
is_force_to_tagged_pdf: |  | (BOOL) | is_force_to_tagged_pdf

Convert a PDF file to a XML format file.

Parameters

  [in] | src_pdf_path | Path of a PDF file. This should not be an empty string.
  [in] | src_file_password | Password for the input PDF file. If no password is needed for the file, please pass an empty string.
  [in] | saved_xml_path | Path of the saved XML format file as conversion result. This should not be an empty string.
  [in] | saved_image_folder_path | A path to specify a folder where image files will be generated during the converting. If this is an empty string, image files will be generated to a folder named "images" (if not exist, Foxit PDF SDK will generate such folder by default). Folder "images" would be in the same directory with saved XML format file (as parameter saved_xml_path).
  [in] | is_force_to_tagged_pdf | (Only useful when input PDF file is not a tagged PDF file) A boolean value to decide whether input PDF file is allowed to be converted to a tagged PDF when input PDF file is not a tagged PDF: YES means input PDF file (which is not tagged PDF yet) will first be converted to a tagged PDF. Then the tagged PDF will be converted to a XML format file. NO means not allow to convert input PDF file (which is not tagged PDF yet) to a tagged PDF. In this case, input PDF file will not be converted to XML format file and this function will return NO.

Returns
  YES means success, while NO means failure.