Foxit PDF SDK
fs_pdf2office.h
浏览该文件的文档.
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 
156 
165 };
166 
168 class PDF2PowerPointSettingData FS_FINAL : public Object{
169  public:
173  , enable_adapt_to_largest_page(false) { }
174 
191  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
192  this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
193  }
194 
205  return (*this);
206  }
207 
226  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
227  this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
228  }
229 
239 
250 };
251 
253 class PDF2ExcelSettingData FS_FINAL : public Object{
254  public:
260  typedef enum _WorkbookSettings {
268 
271  : decimal_symbol("")
273  , thousands_separator("")
275  ,include_watermarks(false) { }
276 
291  this->decimal_symbol = decimal_symbol;
292  this->thousands_separator = thousands_separator;
293  this->workbook_settings = workbook_settings;
294  this->enable_aggressive_table_repair = enable_aggressive_table_repair;
295  this->include_watermarks = include_watermarks;
296  }
297 
306  this->decimal_symbol = data.decimal_symbol;
311  return (*this);
312  }
313 
330  this->decimal_symbol = decimal_symbol;
331  this->thousands_separator = thousands_separator;
332  this->workbook_settings = workbook_settings;
333  this->enable_aggressive_table_repair = enable_aggressive_table_repair;
334  this->include_watermarks = include_watermarks;
335  }
336 
350 
365 
373 
383 
393 };
394 
396 class PDF2OfficeSettingData FS_FINAL : public Object {
397  public:
400  : enable_ml_recognition(false)
401  , include_pdf_comments(true)
402  , enable_trailing_space(true)
403  , include_images(true)
404  , timeout(0)
405  , enable_matching_system_fonts(false) { }
406 
446  this->metrics_data_folder_path = metrics_data_folder_path;
447  this->enable_ml_recognition = enable_ml_recognition;
448  this->page_range = page_range;
449  this->include_pdf_comments = include_pdf_comments;
450  this->word_setting_data = word_setting_data;
451  this->power_point_setting_data = power_point_setting_data;
452  this->excel_setting_data = excel_setting_data;
453  this->enable_trailing_space = enable_trailing_space;
454  this->include_images = include_images;
455  this->timeout = timeout;
456  this->enable_matching_system_fonts = enable_matching_system_fonts;
457  }
458 
469  page_range = data.page_range;
476  timeout = data.timeout;
478  return (*this);
479  }
480 
524  this->metrics_data_folder_path = metrics_data_folder_path;
525  this->enable_ml_recognition = enable_ml_recognition;
526  this->page_range = page_range;
527  this->include_pdf_comments = include_pdf_comments;
528  this->word_setting_data = word_setting_data;
529  this->power_point_setting_data = power_point_setting_data;
530  this->excel_setting_data = excel_setting_data;
531  this->enable_trailing_space = enable_trailing_space;
532  this->include_images = include_images;
533  this->timeout = timeout;
534  this->enable_matching_system_fonts = enable_matching_system_fonts;
535  }
536 
546 
560 
569 
578 
586 
594 
602 
614 
624 
636  int timeout;
637 
646 };
647 
653  public:
659  virtual bool NeedToPause() = 0;
660 
669  virtual void ProgressNotify(int converted_count, int total_count) = 0;
670 };
671 
678  public:
688  virtual bool CheckUserPermissions(uint32 user_permissions) = 0;
689 };
690 
699 class PDF2Office FS_FINAL : public Base {
700  public:
717  static void Initialize(const wchar_t* library_path, const wchar_t* fx_engine_path = L"");
718 
726  static void Release();
727 
735  static String GetVersion();
736 
751  static bool SetConvertCheckCallback(ConvertCheckCallback* convert_check_callback);
752 
775  static common::Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
776  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
777 
801  static common::Progressive StartConvertToWord(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_word_file_stream,
802  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
803 
827  static common::Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
828  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
829 
853  static common::Progressive StartConvertToExcel(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_excel_file_stream,
854  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
855 
878  static common::Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
879  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
880 
904  static common::Progressive StartConvertToPowerPoint(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_ppt_file_stream,
905  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
906 
907 };
908 
909 } // namespace pdf2office
910 } // namespace conversion
911 } // namespace addon
912 } // namespace foxit
913 
914 #endif //defined(WIN32)
915 #endif
static String GetVersion()
获取Foxit PDF转换SDK的版本。
bool enable_generate_page_rendered_break
一个布尔值,指示是否在PDF文档到Word格式文档的转换过程中 在Word格式文档中生成"lastRenderedPageBreak"标记。默认值:false。
Definition: fs_pdf2office.h:155
bool enable_ml_recognition
一个布尔值,指示是否启用基于机器学习的识别功能。默认值:false。
Definition: fs_pdf2office.h:559
WString metrics_data_folder_path
包含度量数据文件的文件夹的有效路径。这不应该是空字符串。
Definition: fs_pdf2office.h:545
Definition: fs_common.h:1364
virtual bool CheckUserPermissions(uint32 user_permissions)=0
检查用户权限以决定是否继续进行PDF到Office的转换。
bool enable_trailing_space
一个布尔值,指示是否在PDF文档到Office格式文档的转换中 为段落中的行添加尾随空格。默认值:true。
Definition: fs_pdf2office.h:613
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
WorkbookSettings workbook_settings
一个枚举值,指示PDF文档到Excel格式文档转换的工作簿设置。
Definition: fs_pdf2office.h:372
String thousands_separator
一个字符串值,指示在PDF文档到Excel格式文档的转换过程中被识别为千位分隔符的符号。
Definition: fs_pdf2office.h:364
void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
设置值。
Definition: fs_pdf2office.h:329
PDF2PowerPointSettingData & operator=(const PDF2PowerPointSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:202
为每个页面创建工作表。
Definition: fs_pdf2office.h:266
common::Range page_range
一个范围对象,指定某些页面。这些页面将用于将PDF文档转换为Office格式文档。
Definition: fs_pdf2office.h:568
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)
带参数的构造函数。
Definition: fs_pdf2office.h:67
bool enable_adapt_to_largest_page
一个布尔值,用于指示在将 PDF 文档转换为 PowerPoint 格式时,是否将较小页面的内容适配到最大页面尺寸。 默认值为 false。
Definition: fs_pdf2office.h:249
void Set(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
设置值。
Definition: fs_pdf2office.h:225
文件读取接口。
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)
设置值。
Definition: fs_pdf2office.h:520
PDF2OfficeSettingData()
构造函数。
Definition: fs_pdf2office.h:399
宽字符串类
Definition: fx_string.h:1457
PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
带参数的构造函数。
Definition: fs_pdf2office.h:290
int max_blank_paragraphs_per_page_bottom
在将 PDF 文件转换为 Word 文档时,指定每一页底部允许放置的最大空白段落数量。
Definition: fs_pdf2office.h:164
bool enable_generate_footnotes_and_endnotes
一个布尔值,指示是否在PDF文档到Word格式文档的转换过程中 将从PDF文档识别的脚注和尾注转换为Word格式文档的脚注和尾注。默认值:false。
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)
设置值。
Definition: fs_pdf2office.h:112
bool include_images
一个布尔值,指示是否在PDF文档到Office格式文档的转换中 包含PDF文档中的图像。默认值:true。
Definition: fs_pdf2office.h:623
bool include_pdf_comments
一个布尔值,指示是否在PDF文档到Office格式文档的转换中 包含PDF文档注释。默认值:true。
Definition: fs_pdf2office.h:577
int timeout
PDF转换超时时间(毫秒)。
Definition: fs_pdf2office.h:636
virtual bool NeedToPause()=0
用于暂停当前转换进度的回调函数。
virtual void ProgressNotify(int converted_count, int total_count)=0
用于通知当前转换进度的回调函数。
为文档创建单个工作表。
Definition: fs_pdf2office.h:262
文件流接口,用于读取和写入。
Definition: fx_stream.h:692
PDF2WordSettingData word_setting_data
用于将PDF文档转换为Word格式文档的设置数据对象。
Definition: fs_pdf2office.h:585
PDF2ExcelSettingData excel_setting_data
用于将PDF文档转换为Excel格式文档的设置数据对象。
Definition: fs_pdf2office.h:601
PDF2WordSettingData & operator=(const PDF2WordSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:82
PDF2OfficeSettingData & operator=(const PDF2OfficeSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:466
Definition: fs_common.h:373
static bool SetConvertCheckCallback(ConvertCheckCallback *convert_check_callback)
设置检查PDF到Office转换条件的回调对象。
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
PDF2ExcelSettingData()
构造函数。
Definition: fs_pdf2office.h:270
通用定义和类的头文件。
static void Release()
释放Foxit PDF转换分配的所有资源。
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)
开始将PDF文件转换为Excel格式文件。必须在调用此函数之前调用函数PDF2Office::Initialize。
PDF2PowerPointSettingData power_point_setting_data
用于将PDF文档转换为PowerPoint格式文档的设置数据对象。
Definition: fs_pdf2office.h:593
Definition: fs_basictypes.h:465
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)
带参数的构造函数。
Definition: fs_pdf2office.h:442
WorkbookSettings
Excel工作簿设置的枚举。
Definition: fs_pdf2office.h:260
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)
开始将PDF文件转换为Word格式文件。必须在调用此函数之前调用函数PDF2Office::Initialize。
PDF2PowerPointSettingData()
构造函数。
Definition: fs_pdf2office.h:171
PDF2PowerPointSettingData(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
带参数的构造函数。
Definition: fs_pdf2office.h:190
static void Initialize(const wchar_t *library_path, const wchar_t *fx_engine_path=L"")
初始化Foxit PDF转换。
bool enable_aggressively_split_sections
一个布尔值,指示是否在PDF文档到PowerPoint格式文档的转换中激进地分割节。默认值:false。
Definition: fs_pdf2office.h:238
Foxit命名空间。
Definition: fs_pdf3d.h:26
PDF2WordSettingData()
构造函数。
Definition: fs_pdf2office.h:41
字节字符串类
Definition: fx_string.h:317
bool enable_matching_system_fonts
一个布尔值,用于指示在将 PDF 文档转换为 Office 格式文档时,是否精确匹配系统字体。默认值为false。
Definition: fs_pdf2office.h:645
为每个表格创建工作表。
Definition: fs_pdf2office.h:264
#define NULL
空指针值。
Definition: fx_system.h:792
bool include_watermarks
一个布尔值,指示在将PDF文档转换为Excel格式文档时是否包含水印。默认值:false。
Definition: fs_pdf2office.h:392
bool enable_generate_headers_and_footers
一个布尔值,指示是否在PDF文档到Word格式文档的转换过程中 将从PDF文档识别的页眉和页脚转换为Word格式文档的页眉和页脚。默认值:false。
Definition: fs_pdf2office.h:135
String decimal_symbol
一个字符串值,指示在PDF文档到Excel格式文档的转换过程中被识别为小数点的符号。
Definition: fs_pdf2office.h:349
bool enable_retain_page_layout
一个布尔值,指示是否在PDF文档到Word格式文档的转换中保留页面布局。默认值:false。
Definition: fs_pdf2office.h:126
PDF2ExcelSettingData & operator=(const PDF2ExcelSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:305
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)
开始将PDF文件转换为PowerPoint格式文件。必须在调用此函数之前调用函数PDF2Office::Initialize。
bool enable_aggressive_table_repair
一个布尔值,指示在将PDF文档转换为Excel格式文档时是否启用强化表格修复。默认值:true。
Definition: fs_pdf2office.h:382