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:
41  PDF2WordSettingData()
42  : enable_retain_page_layout(false)
43  , enable_generate_headers_and_footers(false)
44  , enable_generate_footnotes_and_endnotes(false){ }
45 
63  PDF2WordSettingData(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes) {
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  }
68 
76  PDF2WordSettingData & operator = (const PDF2WordSettingData & data) {
77  enable_retain_page_layout = data.enable_retain_page_layout;
78  enable_generate_headers_and_footers = data.enable_generate_headers_and_footers;
79  enable_generate_footnotes_and_endnotes = data.enable_generate_footnotes_and_endnotes;
80  return (*this);
81  }
82 
101  void Set(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes) {
102  this->enable_retain_page_layout = enable_retain_page_layout;
103  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
104  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
105  }
106 
113  bool enable_retain_page_layout;
114 
122  bool enable_generate_headers_and_footers;
123 
131  bool enable_generate_footnotes_and_endnotes;
132 };
133 
135 class PDF2PowerPointSettingData FS_FINAL : public Object{
136  public:
138  PDF2PowerPointSettingData()
139  : enable_aggressively_split_sections(false) {}
140 
150  PDF2PowerPointSettingData(bool enable_aggressively_split_sections) {
151  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
152  }
153 
161  PDF2PowerPointSettingData & operator = (const PDF2PowerPointSettingData & data) {
162  enable_aggressively_split_sections = data.enable_aggressively_split_sections;
163  return (*this);
164  }
165 
177  void Set(bool enable_aggressively_split_sections) {
178  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
179  }
180 
189  bool enable_aggressively_split_sections;
190 };
191 
193 class PDF2ExcelSettingData FS_FINAL : public Object{
194  public:
196  PDF2ExcelSettingData()
197  : decimal_symbol("")
198  , thousands_separator("") { }
199 
206  PDF2ExcelSettingData(String decimal_symbol, String thousands_separator) {
207  this->decimal_symbol = decimal_symbol;
208  this->thousands_separator = thousands_separator;
209  }
210 
218  PDF2ExcelSettingData & operator = (const PDF2ExcelSettingData & data) {
219  this->decimal_symbol = data.decimal_symbol;
220  this->thousands_separator = data.thousands_separator;
221  return (*this);
222  }
223 
232  void Set(String decimal_symbol, String thousands_separator) {
233  this->decimal_symbol = decimal_symbol;
234  this->thousands_separator = thousands_separator;
235  }
236 
250  String decimal_symbol;
251 
266  String thousands_separator;
267 
268 };
269 
271 class PDF2OfficeSettingData FS_FINAL : public Object {
272  public:
274  PDF2OfficeSettingData()
275  : enable_ml_recognition(false)
276  , include_pdf_comments(true) {}
277 
301  PDF2OfficeSettingData(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const common::Range& page_range, bool include_pdf_comments,
302  const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
303  const PDF2ExcelSettingData& excel_setting_data) {
304  this->metrics_data_folder_path = metrics_data_folder_path;
305  this->enable_ml_recognition = enable_ml_recognition;
306  this->page_range = page_range;
307  this->include_pdf_comments = include_pdf_comments;
308  this->word_setting_data = word_setting_data;
309  this->power_point_setting_data = power_point_setting_data;
310  }
311 
319  PDF2OfficeSettingData &operator = (const PDF2OfficeSettingData& data) {
320  metrics_data_folder_path = data.metrics_data_folder_path;
321  enable_ml_recognition = data.enable_ml_recognition;
322  page_range = data.page_range;
323  include_pdf_comments = data.include_pdf_comments;
324  word_setting_data = data.word_setting_data;
325  power_point_setting_data = data.power_point_setting_data;
326 
327  return (*this);
328  }
329 
355  void Set(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const common::Range &page_range, bool include_pdf_comments,
356  const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
357  const PDF2ExcelSettingData& excel_setting_data) {
358  this->metrics_data_folder_path = metrics_data_folder_path;
359  this->enable_ml_recognition = enable_ml_recognition;
360  this->page_range = page_range;
361  this->include_pdf_comments = include_pdf_comments;
362  this->word_setting_data = word_setting_data;
363  this->power_point_setting_data = power_point_setting_data;
364  }
365 
372  WString metrics_data_folder_path;
373 
386  bool enable_ml_recognition;
387 
395  common::Range page_range;
396 
404  bool include_pdf_comments;
405 
412  PDF2WordSettingData word_setting_data;
413 
420  PDF2PowerPointSettingData power_point_setting_data;
421 
428  PDF2ExcelSettingData excel_setting_data;
429 };
430 
435 class ConvertCallback {
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:
475  static void Initialize(const wchar_t* library_path);
476 
484  static void Release();
485 
509  static common::Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
510  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
511 
536  static common::Progressive StartConvertToWord(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_word_file_stream,
537  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
538 
562  static common::Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
563  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
564 
589  static common::Progressive StartConvertToExcel(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_excel_file_stream,
590  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
591 
615  static common::Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
616  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
617 
642  static common::Progressive StartConvertToPowerPoint(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_ppt_file_stream,
643  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
644 
645 };
646 
647 } // namespace pdf2office
648 } // namespace conversion
649 } // namespace addon
650 } // namespace foxit
651 
652 #endif //defined(WIN32)
653 #endif
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:221
fs_common.h
Header file for common definitions and classes.
foxit::WString
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:223
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::common::file::StreamCallback
IFX_FileStream StreamCallback
Definition: fs_file.h:54
foxit::common::file::ReaderCallback
IFX_FileRead ReaderCallback
Definition: fs_file.h:40
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:780
foxit::String
CFX_ByteString String
Byte string.
Definition: fs_basictypes.h:225