Foxit PDF Conversion SDK
fs_pdf2office.h
Go to the documentation of this file.
1 
15 #ifndef FS_CONVERT_H_
16 #define FS_CONVERT_H_
17 
18 #include "common/fs_common.h"
19 
25 namespace foxit {
26 using namespace common;
30 namespace conversion {
34 namespace pdf2office {
36 class PDF2WordSettingData FS_FINAL : public Object{
37  public:
40  : enable_retain_page_layout(false)
41  , enable_generate_headers_and_footers(false)
42  , enable_generate_footnotes_and_endnotes(false)
43  , enable_generate_page_rendered_break(false) { }
44 
63  PDF2WordSettingData(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes, bool enable_generate_page_rendered_break) {
64  this->enable_retain_page_layout = enable_retain_page_layout;
65  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
66  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
67  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
68  }
69 
77  PDF2WordSettingData & operator = (const PDF2WordSettingData & data) {
78  enable_retain_page_layout = data.enable_retain_page_layout;
79  enable_generate_headers_and_footers = data.enable_generate_headers_and_footers;
80  enable_generate_footnotes_and_endnotes = data.enable_generate_footnotes_and_endnotes;
81  enable_generate_page_rendered_break = data.enable_generate_page_rendered_break;
82  return (*this);
83  }
84 
105  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) {
106  this->enable_retain_page_layout = enable_retain_page_layout;
107  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
108  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
109  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
110  }
111 
119 
128 
137 
149 };
150 
152 class PDF2PowerPointSettingData FS_FINAL : public Object{
153  public:
156  : enable_aggressively_split_sections(false) {}
157 
167  PDF2PowerPointSettingData(bool enable_aggressively_split_sections) {
168  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
169  }
170 
179  enable_aggressively_split_sections = data.enable_aggressively_split_sections;
180  return (*this);
181  }
182 
194  void Set(bool enable_aggressively_split_sections) {
195  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
196  }
197 
207 };
208 
210 class PDF2ExcelSettingData FS_FINAL : public Object {
211  public:
217  typedef enum _WorkbookSettings {
219  e_WorkbookSettingsDocument = 0,
221  e_WorkbookSettingsEachTable = 1,
223  e_WorkbookSettingsEachPage = 2
224  } WorkbookSettings;
225 
228  : decimal_symbol("")
229  , thousands_separator("")
230  , workbook_settings(PDF2ExcelSettingData::e_WorkbookSettingsEachPage){ }
231 
239  PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings) {
240  this->decimal_symbol = decimal_symbol;
241  this->thousands_separator = thousands_separator;
242  this->workbook_settings = workbook_settings;
243  }
244 
252  PDF2ExcelSettingData& operator = (const PDF2ExcelSettingData& data) {
253  this->decimal_symbol = data.decimal_symbol;
254  this->thousands_separator = data.thousands_separator;
255  this->workbook_settings = data.workbook_settings;
256  return (*this);
257  }
258 
268  void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings) {
269  this->decimal_symbol = decimal_symbol;
270  this->thousands_separator = thousands_separator;
271  this->workbook_settings = workbook_settings;
272  }
273 
288 
304 
312 };
313 
315 class PDF2OfficeSettingData FS_FINAL : public Object {
316  public:
319  : enable_ml_recognition(false)
320  , include_pdf_comments(true)
321  , enable_trailing_space(true)
322  , include_images(true) { }
323 
358  PDF2OfficeSettingData(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const Range& page_range, bool include_pdf_comments,
359  const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
360  const PDF2ExcelSettingData& excel_setting_data, bool enable_trailing_space, bool include_images) {
361  this->metrics_data_folder_path = metrics_data_folder_path;
362  this->enable_ml_recognition = enable_ml_recognition;
363  this->page_range = page_range;
364  this->include_pdf_comments = include_pdf_comments;
365  this->word_setting_data = word_setting_data;
366  this->power_point_setting_data = power_point_setting_data;
367  this->excel_setting_data = excel_setting_data;
368  this->enable_trailing_space = enable_trailing_space;
369  this->include_images = include_images;
370  }
371 
379  PDF2OfficeSettingData &operator = (const PDF2OfficeSettingData& data) {
380  metrics_data_folder_path = data.metrics_data_folder_path;
381  enable_ml_recognition = data.enable_ml_recognition;
382  page_range = data.page_range;
383  include_pdf_comments = data.include_pdf_comments;
384  word_setting_data = data.word_setting_data;
385  power_point_setting_data = data.power_point_setting_data;
386  excel_setting_data = data.excel_setting_data;
387  enable_trailing_space = data.enable_trailing_space;
388  include_images = data.include_images;
389  return (*this);
390  }
391 
427  void Set(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const Range &page_range, bool include_pdf_comments,
428  const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
429  const PDF2ExcelSettingData& excel_setting_data, bool enable_trailing_space, bool include_images) {
430  this->metrics_data_folder_path = metrics_data_folder_path;
431  this->enable_ml_recognition = enable_ml_recognition;
432  this->page_range = page_range;
433  this->include_pdf_comments = include_pdf_comments;
434  this->word_setting_data = word_setting_data;
435  this->power_point_setting_data = power_point_setting_data;
436  this->excel_setting_data = excel_setting_data;
437  this->enable_trailing_space = enable_trailing_space;
438  this->include_images = include_images;
439  }
440 
450 
464 
473 
482 
490 
498 
506 
519 
530 };
531 
537  public:
543  virtual bool NeedToPause() = 0;
544 
553  virtual void ProgressNotify(int converted_count, int total_count) = 0;
554 };
555 
564 class PDF2Office FS_FINAL : public Base {
565  public:
593  static Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
594  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
595 
624  static Progressive StartConvertToWord(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_word_file_stream,
625  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
626 
653  static Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
654  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
655 
683  static Progressive StartConvertToExcel(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_excel_file_stream,
684  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
685 
712  static Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
713  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
714 
742  static Progressive StartConvertToPowerPoint(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_ppt_file_stream,
743  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
744 };
745 } // namespace pdf2office
746 } // namespace conversion
747 } // namespace foxit
748 
749 #endif
PDF2PowerPointSettingData()
Constructor.
Definition: fs_pdf2office.h:155
Definition: fs_common.h:271
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:63
CFX_Object Object
Object type.
Definition: fs_basictypes.h:145
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:105
File reading interface.
Definition: fx_stream.h:566
bool enable_trailing_space
A boolean value which indicates whether to add trailing spaces from lines in paragraphs for convertin...
Definition: fs_pdf2office.h:518
WIDE STRING CLASS.
Definition: fx_string.h:1452
PDF2WordSettingData word_setting_data
A setting data object that used for converting PDF documents to Word format documents.
Definition: fs_pdf2office.h:489
bool enable_aggressively_split_sections
A boolean value which indicates whether split sections aggressively for the conversion of PDF documen...
Definition: fs_pdf2office.h:206
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:127
String thousands_separator
A string value which indicates being recognized as thousands separator during the conversion of PDF d...
Definition: fs_pdf2office.h:303
bool enable_generate_page_rendered_break
A boolean value which indicates whether to generate the "lastRenderedPageBreak" marker in word format...
Definition: fs_pdf2office.h:148
PDF2ExcelSettingData excel_setting_data
A setting data object that used for converting PDF documents to Excel format documents.
Definition: fs_pdf2office.h:505
void Set(bool enable_aggressively_split_sections)
Set value.
Definition: fs_pdf2office.h:194
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:449
PDF2PowerPointSettingData(bool enable_aggressively_split_sections)
Constructor, with parameters.
Definition: fs_pdf2office.h:167
File stream interface, reading & writing.
Definition: fx_stream.h:669
PDF2PowerPointSettingData power_point_setting_data
A setting data object that used for converting PDF documents to Power Point format documents.
Definition: fs_pdf2office.h:497
Definition: fs_common.h:208
WorkbookSettings
Enumeration for Excel workbook settings.
Definition: fs_pdf2office.h:217
Header file for common definitions and classes.
PDF2WordSettingData()
Constructor.
Definition: fs_pdf2office.h:39
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:118
String decimal_symbol
A string value which indicates being recognized as decimal during the conversion of PDF documents to ...
Definition: fs_pdf2office.h:287
PDF2OfficeSettingData(const wchar_t *metrics_data_folder_path, bool enable_ml_recognition, const 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)
Constructor, with parameters.
Definition: fs_pdf2office.h:358
bool include_images
A boolean value which indicates whether to include images in PDF documents for converting PDF documen...
Definition: fs_pdf2office.h:529
Definition: fs_basictypes.h:230
PDF2ExcelSettingData()
Constructor.
Definition: fs_pdf2office.h:227
void Set(const wchar_t *metrics_data_folder_path, bool enable_ml_recognition, const 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)
Set value.
Definition: fs_pdf2office.h:427
Foxit namespace.
Definition: fs_basictypes.h:124
WorkbookSettings workbook_settings
An enumeration value which indicates the setting of the workbook for the conversion of PDF documents ...
Definition: fs_pdf2office.h:311
Definition: fs_pdf2office.h:564
BYTE STRING CLASS.
Definition: fx_string.h:317
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:481
Definition: fs_pdf2office.h:536
PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings)
Constructor, with parameters.
Definition: fs_pdf2office.h:239
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:136
#define NULL
The null-pointer value.
Definition: fx_system.h:780
PDF2OfficeSettingData()
Constructor.
Definition: fs_pdf2office.h:318
void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings)
Set value.
Definition: fs_pdf2office.h:268
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:472
bool enable_ml_recognition
A boolean value which indicates whether enable machine learning-based recognition functionality....
Definition: fs_pdf2office.h:463