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 
52  PDF2WordSettingData(bool enable_retain_page_layout) {
53  this->enable_retain_page_layout = enable_retain_page_layout;
54  }
55 
63  PDF2WordSettingData & operator = (const PDF2WordSettingData & data) {
64  enable_retain_page_layout = data.enable_retain_page_layout;
65  return (*this);
66  }
67 
77  void Set(bool enable_retain_page_layout) {
78  this->enable_retain_page_layout = enable_retain_page_layout;
79  }
80 
88  bool enable_retain_page_layout;
89 };
90 
92 class PDF2OfficeSettingData FS_FINAL : public Object {
93  public:
95  PDF2OfficeSettingData()
96  : enable_ml_recognition(false)
97  , include_pdf_comments(true) {}
98 
120  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) {
121  this->metrics_data_folder_path = metrics_data_folder_path;
122  this->enable_ml_recognition = enable_ml_recognition;
123  this->page_range = page_range;
124  this->include_pdf_comments = include_pdf_comments;
125  this->word_setting_data = word_setting_data;
126  }
127 
135  PDF2OfficeSettingData &operator = (const PDF2OfficeSettingData& data) {
136  metrics_data_folder_path = data.metrics_data_folder_path;
137  enable_ml_recognition = data.enable_ml_recognition;
138  page_range = data.page_range;
139  include_pdf_comments = data.include_pdf_comments;
140  word_setting_data = data.word_setting_data;
141 
142  return (*this);
143  }
144 
168  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) {
169  this->metrics_data_folder_path = metrics_data_folder_path;
170  this->enable_ml_recognition = enable_ml_recognition;
171  this->page_range = page_range;
172  this->include_pdf_comments = include_pdf_comments;
173  this->word_setting_data = word_setting_data;
174  }
175 
182  WString metrics_data_folder_path;
183 
196  bool enable_ml_recognition;
197 
206  common::Range page_range;
207 
215  bool include_pdf_comments;
216 
223  PDF2WordSettingData word_setting_data;
224 };
225 
230 class ConvertCallback {
231  public:
237  virtual bool NeedToPause() = 0;
238 
247  virtual void ProgressNotify(int converted_count, int total_count) = 0;
248 };
249 
258 class PDF2Office FS_FINAL : public Base {
259  public:
270  static void Initialize(const wchar_t* library_path);
271 
279  static void Release();
280 
304  static common::Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
305  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
306 
331  static common::Progressive StartConvertToWord(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_word_file_stream,
332  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
333 
357  static common::Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
358  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
359 
384  static common::Progressive StartConvertToExcel(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_excel_file_stream,
385  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
386 
410  static common::Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
411  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
412 
437  static common::Progressive StartConvertToPowerPoint(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_ppt_file_stream,
438  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
439 
440 };
441 
442 } // namespace pdf2office
443 } // namespace conversion
444 } // namespace addon
445 } // namespace foxit
446 
447 #endif //defined(WIN32)
448 #endif
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:217
fs_common.h
Header file for common definitions and classes.
foxit::WString
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:219
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