Foxit PDF SDK
fs_pdf2office.h
Go to the documentation of this file.
1 
14 #ifndef FS_PDF2OFFICE_H_
15 #define FS_PDF2OFFICE_H_
16 #if defined(_WIN32) || defined(_WIN64) || (defined(__linux__) && !defined(__ANDROID__))
17 #include "common/fs_common.h"
18 
24 namespace foxit {
28 namespace addon {
32 namespace conversion {
36 namespace pdf2office {
38 class PDF2WordSettingData FS_FINAL : public Object{
39  public:
46 
66  this->enable_retain_page_layout = enable_retain_page_layout;
67  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
68  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
69  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
70  }
71 
84  return (*this);
85  }
86 
107  this->enable_retain_page_layout = enable_retain_page_layout;
108  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
109  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
110  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
111  }
112 
120 
129 
138 
150 };
151 
153 class PDF2PowerPointSettingData FS_FINAL : public Object{
154  public:
158 
169  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
170  }
171 
181  return (*this);
182  }
183 
196  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
197  }
198 
208 };
209 
211 class PDF2ExcelSettingData FS_FINAL : public Object{
212  public:
218  typedef enum _WorkbookSettings {
226 
229  : decimal_symbol("")
231  , thousands_separator("") { }
232 
241  this->decimal_symbol = decimal_symbol;
242  this->thousands_separator = thousands_separator;
243  this->workbook_settings = workbook_settings;
244  }
245 
254  this->decimal_symbol = data.decimal_symbol;
257  return (*this);
258  }
259 
270  this->decimal_symbol = decimal_symbol;
271  this->thousands_separator = thousands_separator;
272  this->workbook_settings = workbook_settings;
273  }
274 
289 
305 
313 };
314 
316 class PDF2OfficeSettingData FS_FINAL : public Object {
317  public:
320  : enable_ml_recognition(false)
321  , include_pdf_comments(true)
322  , enable_trailing_space(true)
323  , include_images(true)
324  , timeout(0) { }
325 
364  this->metrics_data_folder_path = metrics_data_folder_path;
365  this->enable_ml_recognition = enable_ml_recognition;
366  this->page_range = page_range;
367  this->include_pdf_comments = include_pdf_comments;
368  this->word_setting_data = word_setting_data;
369  this->power_point_setting_data = power_point_setting_data;
370  this->excel_setting_data = excel_setting_data;
371  this->enable_trailing_space = enable_trailing_space;
372  this->include_images = include_images;
373  this->timeout = timeout;
374  }
375 
386  page_range = data.page_range;
393  timeout = data.timeout;
394  return (*this);
395  }
396 
437  this->metrics_data_folder_path = metrics_data_folder_path;
438  this->enable_ml_recognition = enable_ml_recognition;
439  this->page_range = page_range;
440  this->include_pdf_comments = include_pdf_comments;
441  this->word_setting_data = word_setting_data;
442  this->power_point_setting_data = power_point_setting_data;
443  this->excel_setting_data = excel_setting_data;
444  this->enable_trailing_space = enable_trailing_space;
445  this->include_images = include_images;
446  this->timeout = timeout;
447  }
448 
458 
472 
481 
490 
498 
506 
514 
527 
538 
550  int timeout;
551 };
552 
558  public:
564  virtual bool NeedToPause() = 0;
565 
574  virtual void ProgressNotify(int converted_count, int total_count) = 0;
575 };
576 
583  public:
593  virtual bool CheckUserPermissions(uint32 user_permissions) = 0;
594 };
595 
604 class PDF2Office FS_FINAL : public Base {
605  public:
622  static void Initialize(const wchar_t* library_path, const wchar_t* fx_engine_path = L"");
623 
631  static void Release();
632 
649  static bool SetConvertCheckCallback(ConvertCheckCallback* convert_check_callback);
650 
676  static common::Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
677  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
678 
705  static common::Progressive StartConvertToWord(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_word_file_stream,
706  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
707 
733  static common::Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
734  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
735 
762  static common::Progressive StartConvertToExcel(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_excel_file_stream,
763  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
764 
790  static common::Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
791  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
792 
819  static common::Progressive StartConvertToPowerPoint(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_ppt_file_stream,
820  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
821 
822 };
823 
824 } // namespace pdf2office
825 } // namespace conversion
826 } // namespace addon
827 } // namespace foxit
828 
829 #endif //defined(WIN32)
830 #endif
PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings)
Constructor, with parameters.
Definition: fs_pdf2office.h:240
bool enable_generate_page_rendered_break
A boolean value which indicates whether to generate the "lastRenderedPageBreak" marker in word format...
Definition: fs_pdf2office.h:149
bool enable_ml_recognition
A boolean value which indicates whether enable machine learning-based recognition functionality....
Definition: fs_pdf2office.h:471
WString metrics_data_folder_path
A valid path of a folder which contains metrics data files. This should not be an empty string.
Definition: fs_pdf2office.h:457
Definition: fs_common.h:1273
virtual bool CheckUserPermissions(uint32 user_permissions)=0
Check user permissions to decide whether to proceed with the PDF to Office conversion.
bool enable_trailing_space
A boolean value which indicates whether to add trailing spaces from lines in paragraphs for convertin...
Definition: fs_pdf2office.h:526
CFX_Object Object
Object type.
Definition: fs_basictypes.h:221
WorkbookSettings workbook_settings
An enumeration value which indicates the setting of the workbook for the conversion of PDF documents ...
Definition: fs_pdf2office.h:312
String thousands_separator
A string value which indicates being recognized as thousands separator during the conversion of PDF d...
Definition: fs_pdf2office.h:304
PDF2PowerPointSettingData & operator=(const PDF2PowerPointSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:179
Create worksheet for each page.
Definition: fs_pdf2office.h:224
common::Range page_range
A range object that specifies some pages. These pages will be used to convert PDF documents to office...
Definition: fs_pdf2office.h:480
void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings)
Set value.
Definition: fs_pdf2office.h:269
void Set(const wchar_t *metrics_data_folder_path, bool enable_ml_recognition, const common::Range &page_range, bool include_pdf_comments, const PDF2WordSettingData &word_setting_data, const PDF2PowerPointSettingData &power_point_setting_data, const PDF2ExcelSettingData &excel_setting_data, bool enable_trailing_space, bool include_images, int timeout)
Set value.
Definition: fs_pdf2office.h:434
File reading interface.
Definition: fx_stream.h:570
PDF2OfficeSettingData()
Constructor.
Definition: fs_pdf2office.h:319
WIDE STRING CLASS.
Definition: fx_string.h:1461
bool enable_generate_footnotes_and_endnotes
A boolean value which indicates whether convert the recognized footnotes and endnotes from PDF docume...
Definition: fs_pdf2office.h:137
void Set(bool enable_aggressively_split_sections)
Set value.
Definition: fs_pdf2office.h:195
PDF2OfficeSettingData(const wchar_t *metrics_data_folder_path, bool enable_ml_recognition, const common::Range &page_range, bool include_pdf_comments, const PDF2WordSettingData &word_setting_data, const PDF2PowerPointSettingData &power_point_setting_data, const PDF2ExcelSettingData &excel_setting_data, bool enable_trailing_space, bool include_images, int timeout)
Constructor, with parameters.
Definition: fs_pdf2office.h:361
void Set(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes, bool enable_generate_page_rendered_break)
Set value.
Definition: fs_pdf2office.h:106
PDF2WordSettingData(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes, bool enable_generate_page_rendered_break)
Constructor, with parameters.
Definition: fs_pdf2office.h:65
bool include_images
A boolean value which indicates whether to include images in PDF documents for converting PDF documen...
Definition: fs_pdf2office.h:537
bool include_pdf_comments
A boolean value which indicates whether to include PDF documents comments for the conversion of PDF d...
Definition: fs_pdf2office.h:489
int timeout
Milliseconds for timeout used for PDF Conversion.
Definition: fs_pdf2office.h:550
PDF2PowerPointSettingData(bool enable_aggressively_split_sections)
Constructor, with parameters.
Definition: fs_pdf2office.h:168
virtual bool NeedToPause()=0
A callback function used to pause the current conversion progress.
virtual void ProgressNotify(int converted_count, int total_count)=0
A callback function used to notify the current conversion progress.
Create single worksheet for the document.
Definition: fs_pdf2office.h:220
File stream interface, reading & writing.
Definition: fx_stream.h:675
PDF2WordSettingData word_setting_data
A setting data object that used for converting PDF documents to Word format documents.
Definition: fs_pdf2office.h:497
PDF2ExcelSettingData excel_setting_data
A setting data object that used for converting PDF documents to Excel format documents.
Definition: fs_pdf2office.h:513
PDF2WordSettingData & operator=(const PDF2WordSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:79
PDF2OfficeSettingData & operator=(const PDF2OfficeSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:383
Definition: fs_common.h:373
static bool SetConvertCheckCallback(ConvertCheckCallback *convert_check_callback)
Set the callback object to check the PDF to Office conversion conditions.
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:196
PDF2ExcelSettingData()
Constructor.
Definition: fs_pdf2office.h:228
Header file for common definitions and classes.
static void Release()
Release all resource allocated by Foxit PDF Conversion.
static common::Progressive StartConvertToExcel(const wchar_t *src_pdf_path, const wchar_t *src_pdf_password, const wchar_t *saved_excel_file_path, const PDF2OfficeSettingData &setting_data, ConvertCallback *convert_callback=0)
Start to convert a PDF file to a Excel format file. Function PDF2Office::Initialize must be called be...
PDF2PowerPointSettingData power_point_setting_data
A setting data object that used for converting PDF documents to Power Point format documents.
Definition: fs_pdf2office.h:505
Definition: fs_basictypes.h:443
WorkbookSettings
Enumeration for Excel workbook settings.
Definition: fs_pdf2office.h:218
static common::Progressive StartConvertToWord(const wchar_t *src_pdf_path, const wchar_t *src_pdf_password, const wchar_t *saved_word_file_path, const PDF2OfficeSettingData &setting_data, ConvertCallback *convert_callback=0)
Start to convert a PDF file to a Word format file. Function PDF2Office::Initialize must be called bef...
PDF2PowerPointSettingData()
Constructor.
Definition: fs_pdf2office.h:156
static void Initialize(const wchar_t *library_path, const wchar_t *fx_engine_path=L"")
Initialize Foxit PDF Conversion.
bool enable_aggressively_split_sections
A boolean value which indicates whether split sections aggressively for the conversion of PDF documen...
Definition: fs_pdf2office.h:207
Foxit namespace.
Definition: fs_taggedpdf.h:27
PDF2WordSettingData()
Constructor.
Definition: fs_pdf2office.h:41
BYTE STRING CLASS.
Definition: fx_string.h:317
Create worksheet for each table.
Definition: fs_pdf2office.h:222
#define NULL
The null-pointer value.
Definition: fx_system.h:792
bool enable_generate_headers_and_footers
A boolean value which indicates whether convert the recognized headers and footers from PDF documents...
Definition: fs_pdf2office.h:128
String decimal_symbol
A string value which indicates being recognized as decimal during the conversion of PDF documents to ...
Definition: fs_pdf2office.h:288
bool enable_retain_page_layout
A boolean value which indicates whether retain page layout for the conversion of PDF documents to Wor...
Definition: fs_pdf2office.h:119
PDF2ExcelSettingData & operator=(const PDF2ExcelSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:253
static common::Progressive StartConvertToPowerPoint(const wchar_t *src_pdf_path, const wchar_t *src_pdf_password, const wchar_t *saved_ppt_file_path, const PDF2OfficeSettingData &setting_data, ConvertCallback *convert_callback=0)
Start to convert a PDF file to a PowerPoint format file. Function PDF2Office::Initialize must be call...