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:
47 
68  this->enable_retain_page_layout = enable_retain_page_layout;
69  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
70  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
71  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
72  this->max_blank_paragraphs_per_page_bottom = max_blank_paragraphs_per_page_bottom;
73  }
74 
88  return (*this);
89  }
90 
113  this->enable_retain_page_layout = enable_retain_page_layout;
114  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
115  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
116  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
118  }
119 
127 
136 
145 
157 
167 };
168 
170 class PDF2PowerPointSettingData FS_FINAL : public Object{
171  public:
175  , enable_adapt_to_largest_page(false) { }
176 
194  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
195  this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
196  }
197 
208  return (*this);
209  }
210 
230  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
231  this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
232  }
233 
243 
255 };
256 
258 class PDF2ExcelSettingData FS_FINAL : public Object{
259  public:
265  typedef enum _WorkbookSettings {
273 
276  : decimal_symbol("")
278  , thousands_separator("")
280  , include_watermarks(false) { }
281 
296  this->decimal_symbol = decimal_symbol;
297  this->thousands_separator = thousands_separator;
298  this->workbook_settings = workbook_settings;
299  this->enable_aggressive_table_repair = enable_aggressive_table_repair;
300  this->include_watermarks = include_watermarks;
301  }
302 
311  this->decimal_symbol = data.decimal_symbol;
316  return (*this);
317  }
318 
335  this->decimal_symbol = decimal_symbol;
336  this->thousands_separator = thousands_separator;
337  this->workbook_settings = workbook_settings;
338  this->enable_aggressive_table_repair = enable_aggressive_table_repair;
339  this->include_watermarks = include_watermarks;
340  }
341 
356 
372 
390 
401 };
402 
404 class PDF2OfficeSettingData FS_FINAL : public Object {
405  public:
408  : enable_ml_recognition(false)
409  , include_pdf_comments(true)
410  , enable_trailing_space(true)
411  , include_images(true)
412  , timeout(0)
413  , enable_matching_system_fonts(false) { }
414 
457  this->metrics_data_folder_path = metrics_data_folder_path;
458  this->enable_ml_recognition = enable_ml_recognition;
459  this->page_range = page_range;
460  this->include_pdf_comments = include_pdf_comments;
461  this->word_setting_data = word_setting_data;
462  this->power_point_setting_data = power_point_setting_data;
463  this->excel_setting_data = excel_setting_data;
464  this->enable_trailing_space = enable_trailing_space;
465  this->include_images = include_images;
466  this->timeout = timeout;
467  this->enable_matching_system_fonts = enable_matching_system_fonts;
468  }
469 
480  page_range = data.page_range;
487  timeout = data.timeout;
489  return (*this);
490  }
491 
536  this->metrics_data_folder_path = metrics_data_folder_path;
537  this->enable_ml_recognition = enable_ml_recognition;
538  this->page_range = page_range;
539  this->include_pdf_comments = include_pdf_comments;
540  this->word_setting_data = word_setting_data;
541  this->power_point_setting_data = power_point_setting_data;
542  this->excel_setting_data = excel_setting_data;
543  this->enable_trailing_space = enable_trailing_space;
544  this->include_images = include_images;
545  this->timeout = timeout;
546  this->enable_matching_system_fonts = enable_matching_system_fonts;
547  }
548 
558 
572 
581 
590 
598 
606 
614 
627 
638 
650  int timeout;
651 
662 };
663 
669  public:
675  virtual bool NeedToPause() = 0;
676 
685  virtual void ProgressNotify(int converted_count, int total_count) = 0;
686 };
687 
694  public:
704  virtual bool CheckUserPermissions(uint32 user_permissions) = 0;
705 };
706 
715 class PDF2Office FS_FINAL : public Base {
716  public:
733  static void Initialize(const wchar_t* library_path, const wchar_t* fx_engine_path = L"");
734 
742  static void Release();
743 
751  static String GetVersion();
752 
769  static bool SetConvertCheckCallback(ConvertCheckCallback* convert_check_callback);
770 
796  static common::Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
797  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
798 
825  static common::Progressive StartConvertToWord(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_word_file_stream,
826  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
827 
853  static common::Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
854  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
855 
882  static common::Progressive StartConvertToExcel(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_excel_file_stream,
883  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
884 
910  static common::Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
911  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
912 
939  static common::Progressive StartConvertToPowerPoint(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_ppt_file_stream,
940  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
941 
942 };
943 
944 } // namespace pdf2office
945 } // namespace conversion
946 } // namespace addon
947 } // namespace foxit
948 
949 #endif //defined(WIN32)
950 #endif
static String GetVersion()
Get the version of Foxit PDF Conversion SDK.
bool enable_generate_page_rendered_break
A boolean value which indicates whether to generate the "lastRenderedPageBreak" marker in word format...
Definition: fs_pdf2office.h:156
bool enable_ml_recognition
A boolean value which indicates whether enable machine learning-based recognition functionality....
Definition: fs_pdf2office.h:571
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:557
Definition: fs_common.h:1368
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:626
CFX_Object Object
Object type.
Definition: fs_basictypes.h:220
WorkbookSettings workbook_settings
An enumeration value which indicates the setting of the workbook for the conversion of PDF documents ...
Definition: fs_pdf2office.h:379
String thousands_separator
A string value which indicates being recognized as thousands separator during the conversion of PDF d...
Definition: fs_pdf2office.h:371
void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
Set value.
Definition: fs_pdf2office.h:334
PDF2PowerPointSettingData & operator=(const PDF2PowerPointSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:205
Create worksheet for each page.
Definition: fs_pdf2office.h:271
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:580
PDF2WordSettingData(bool enable_retain_page_layout, bool enable_generate_headers_and_footers, bool enable_generate_footnotes_and_endnotes, bool enable_generate_page_rendered_break, int max_blank_paragraphs_per_page_bottom)
Constructor, with parameters.
Definition: fs_pdf2office.h:67
bool enable_adapt_to_largest_page
A boolean value that indicates whether adapt content of smaller pages to the largest page size during...
Definition: fs_pdf2office.h:254
void Set(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
Set value.
Definition: fs_pdf2office.h:229
File reading interface.
Definition: fx_stream.h:587
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, bool enable_matching_system_fonts)
Set value.
Definition: fs_pdf2office.h:532
PDF2OfficeSettingData()
Constructor.
Definition: fs_pdf2office.h:407
WIDE STRING CLASS.
Definition: fx_string.h:1461
PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
Constructor, with parameters.
Definition: fs_pdf2office.h:295
int max_blank_paragraphs_per_page_bottom
Specifies the maximum number of blank paragraphs that can be placed at the bottom of each page when c...
Definition: fs_pdf2office.h:166
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:144
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:112
bool include_images
A boolean value which indicates whether to include images in PDF documents for converting PDF documen...
Definition: fs_pdf2office.h:637
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:589
int timeout
Milliseconds for timeout used for PDF Conversion.
Definition: fs_pdf2office.h:650
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:267
File stream interface, reading & writing.
Definition: fx_stream.h:692
PDF2WordSettingData word_setting_data
A setting data object that used for converting PDF documents to Word format documents.
Definition: fs_pdf2office.h:597
PDF2ExcelSettingData excel_setting_data
A setting data object that used for converting PDF documents to Excel format documents.
Definition: fs_pdf2office.h:613
PDF2WordSettingData & operator=(const PDF2WordSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:82
PDF2OfficeSettingData & operator=(const PDF2OfficeSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:477
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:195
PDF2ExcelSettingData()
Constructor.
Definition: fs_pdf2office.h:275
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:605
Definition: fs_basictypes.h:451
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, bool enable_matching_system_fonts)
Constructor, with parameters.
Definition: fs_pdf2office.h:453
WorkbookSettings
Enumeration for Excel workbook settings.
Definition: fs_pdf2office.h:265
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:173
PDF2PowerPointSettingData(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
Constructor, with parameters.
Definition: fs_pdf2office.h:193
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:242
Foxit namespace.
Definition: fs_taggedpdf.h:27
PDF2WordSettingData()
Constructor.
Definition: fs_pdf2office.h:41
BYTE STRING CLASS.
Definition: fx_string.h:317
bool enable_matching_system_fonts
A boolean value that indicates whether to accurately match system fonts when converting PDF documents...
Definition: fs_pdf2office.h:661
Create worksheet for each table.
Definition: fs_pdf2office.h:269
#define NULL
The null-pointer value.
Definition: fx_system.h:792
bool include_watermarks
A boolean value that indicates whether to include watermarks during the conversion of PDF documents t...
Definition: fs_pdf2office.h:400
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:135
String decimal_symbol
A string value which indicates being recognized as decimal during the conversion of PDF documents to ...
Definition: fs_pdf2office.h:355
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:126
PDF2ExcelSettingData & operator=(const PDF2ExcelSettingData &data)
Assign operator.
Definition: fs_pdf2office.h:310
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...
bool enable_aggressive_table_repair
A boolean value that indicates whether aggressive table repair is enabled during the conversion of PD...
Definition: fs_pdf2office.h:389