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 
61  PDF2WordSettingData(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes) {
62  this->enable_retain_page_layout = enable_retain_page_layout;
63  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
64  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
65  }
66 
74  PDF2WordSettingData & operator = (const PDF2WordSettingData & data) {
75  enable_retain_page_layout = data.enable_retain_page_layout;
76  enable_generate_headers_and_footers = data.enable_generate_headers_and_footers;
77  enable_generate_footnotes_and_endnotes = data.enable_generate_footnotes_and_endnotes;
78  return (*this);
79  }
80 
99  void Set(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes) {
100  this->enable_retain_page_layout = enable_retain_page_layout;
101  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
102  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
103  }
104 
112 
121 
130 };
131 
133 class PDF2PowerPointSettingData FS_FINAL : public Object{
134  public:
137  : enable_aggressively_split_sections(false) {}
138 
148  PDF2PowerPointSettingData(bool enable_aggressively_split_sections) {
149  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
150  }
151 
160  enable_aggressively_split_sections = data.enable_aggressively_split_sections;
161  return (*this);
162  }
163 
175  void Set(bool enable_aggressively_split_sections) {
176  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
177  }
178 
188 };
189 
191 class PDF2ExcelSettingData FS_FINAL : public Object {
192  public:
195  : decimal_symbol("")
196  , thousands_separator("") { }
197 
204  PDF2ExcelSettingData(String decimal_symbol, String thousands_separator) {
205  this->decimal_symbol = decimal_symbol;
206  this->thousands_separator = thousands_separator;
207  }
208 
216  PDF2ExcelSettingData& operator = (const PDF2ExcelSettingData& data) {
217  this->decimal_symbol = data.decimal_symbol;
218  this->thousands_separator = data.thousands_separator;
219  return (*this);
220  }
221 
230  void Set(String decimal_symbol, String thousands_separator) {
231  this->decimal_symbol = decimal_symbol;
232  this->thousands_separator = thousands_separator;
233  }
234 
249 
265 
266 };
267 
269 class PDF2OfficeSettingData FS_FINAL : public Object {
270  public:
273  : enable_ml_recognition(false)
274  , include_pdf_comments(true) {}
275 
299  PDF2OfficeSettingData(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const Range& page_range, bool include_pdf_comments,
300  const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
301  const PDF2ExcelSettingData& excel_setting_data) {
302  this->metrics_data_folder_path = metrics_data_folder_path;
303  this->enable_ml_recognition = enable_ml_recognition;
304  this->page_range = page_range;
305  this->include_pdf_comments = include_pdf_comments;
306  this->word_setting_data = word_setting_data;
307  this->power_point_setting_data = power_point_setting_data;
308  this->excel_setting_data = excel_setting_data;
309  }
310 
318  PDF2OfficeSettingData &operator = (const PDF2OfficeSettingData& data) {
319  metrics_data_folder_path = data.metrics_data_folder_path;
320  enable_ml_recognition = data.enable_ml_recognition;
321  page_range = data.page_range;
322  include_pdf_comments = data.include_pdf_comments;
323  word_setting_data = data.word_setting_data;
324  power_point_setting_data = data.power_point_setting_data;
325  excel_setting_data = data.excel_setting_data;
326  return (*this);
327  }
328 
354  void Set(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const Range &page_range, bool include_pdf_comments,
355  const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
356  const PDF2ExcelSettingData& excel_setting_data) {
357  this->metrics_data_folder_path = metrics_data_folder_path;
358  this->enable_ml_recognition = enable_ml_recognition;
359  this->page_range = page_range;
360  this->include_pdf_comments = include_pdf_comments;
361  this->word_setting_data = word_setting_data;
362  this->power_point_setting_data = power_point_setting_data;
363  this->excel_setting_data = excel_setting_data;
364  }
365 
373 
387 
396 
405 
413 
421 
429 };
430 
436  public:
442  virtual bool NeedToPause() = 0;
443 
452  virtual void ProgressNotify(int converted_count, int total_count) = 0;
453 };
454 
463 class PDF2Office FS_FINAL : public Base {
464  public:
492  static Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
493  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
494 
523  static Progressive StartConvertToWord(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_word_file_stream,
524  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
525 
552  static Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
553  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
554 
582  static Progressive StartConvertToExcel(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_excel_file_stream,
583  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
584 
611  static Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
612  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
613 
641  static Progressive StartConvertToPowerPoint(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_ppt_file_stream,
642  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
643 };
644 } // namespace pdf2office
645 } // namespace conversion
646 } // namespace foxit
647 
648 #endif
PDF2WordSettingData(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes)
Constructor, with parameters.
Definition: fs_pdf2office.h:61
PDF2PowerPointSettingData()
Constructor.
Definition: fs_pdf2office.h:136
Definition: fs_common.h:178
PDF2ExcelSettingData(String decimal_symbol, String thousands_separator)
Constructor, with parameters.
Definition: fs_pdf2office.h:204
CFX_Object Object
Object type.
Definition: fs_basictypes.h:79
void Set(String decimal_symbol, String thousands_separator)
Set value.
Definition: fs_pdf2office.h:230
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)
Set value.
Definition: fs_pdf2office.h:354
File reading interface.
Definition: fx_stream.h:566
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:412
bool enable_aggressively_split_sections
A boolean value which indicates whether split sections aggressively for the conversion of PDF documen...
Definition: fs_pdf2office.h:187
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:120
String thousands_separator
A string value which indicates being recognized as thousands separator during the conversion of PDF d...
Definition: fs_pdf2office.h:264
PDF2ExcelSettingData excel_setting_data
A setting data object that used for converting PDF documents to Excel format documents.
Definition: fs_pdf2office.h:428
void Set(bool enable_aggressively_split_sections)
Set value.
Definition: fs_pdf2office.h:175
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:372
PDF2PowerPointSettingData(bool enable_aggressively_split_sections)
Constructor, with parameters.
Definition: fs_pdf2office.h:148
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:420
Definition: fs_common.h:115
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:111
String decimal_symbol
A string value which indicates being recognized as decimal during the conversion of PDF documents to ...
Definition: fs_pdf2office.h:248
Definition: fs_basictypes.h:161
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)
Constructor, with parameters.
Definition: fs_pdf2office.h:299
PDF2ExcelSettingData()
Constructor.
Definition: fs_pdf2office.h:194
Foxit namespace.
Definition: fs_basictypes.h:58
Definition: fs_pdf2office.h:463
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:404
Definition: fs_pdf2office.h:435
void Set(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes)
Set value.
Definition: fs_pdf2office.h:99
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:129
#define NULL
The null-pointer value.
Definition: fx_system.h:780
PDF2OfficeSettingData()
Constructor.
Definition: fs_pdf2office.h:272
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:395
bool enable_ml_recognition
A boolean value which indicates whether enable machine learning-based recognition functionality....
Definition: fs_pdf2office.h:386