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:
46 
67  this->enable_retain_page_layout = enable_retain_page_layout;
68  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
69  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
70  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
71  this->max_blank_paragraphs_per_page_bottom = max_blank_paragraphs_per_page_bottom;
72  }
73 
87  return (*this);
88  }
89 
112  this->enable_retain_page_layout = enable_retain_page_layout;
113  this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
114  this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
115  this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
117  }
118 
126 
135 
144 
155 
164 };
165 
167 class PDF2PowerPointSettingData FS_FINAL : public Object{
168  public:
172 
189  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
190  this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
191  }
192 
203  return (*this);
204  }
205 
224  this->enable_aggressively_split_sections = enable_aggressively_split_sections;
225  this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
226  }
227 
237 
248 };
249 
251 class PDF2ExcelSettingData FS_FINAL : public Object{
252  public:
258  typedef enum _WorkbookSettings {
266 
269  : decimal_symbol("")
271  , thousands_separator("")
273  ,include_watermarks(false) { }
274 
289  this->decimal_symbol = decimal_symbol;
290  this->thousands_separator = thousands_separator;
291  this->workbook_settings = workbook_settings;
292  this->enable_aggressive_table_repair = enable_aggressive_table_repair;
293  this->include_watermarks = include_watermarks;
294  }
295 
304  this->decimal_symbol = data.decimal_symbol;
309  return (*this);
310  }
311 
328  this->decimal_symbol = decimal_symbol;
329  this->thousands_separator = thousands_separator;
330  this->workbook_settings = workbook_settings;
331  this->enable_aggressive_table_repair = enable_aggressive_table_repair;
332  this->include_watermarks = include_watermarks;
333  }
334 
348 
363 
371 
381 
391 };
392 
394 class PDF2OfficeSettingData FS_FINAL : public Object {
395  public:
398  : enable_ml_recognition(false)
399  , include_pdf_comments(true)
400  , enable_trailing_space(true)
401  , include_images(true)
402  , timeout(0)
403  , enable_matching_system_fonts(false) { }
404 
444  this->metrics_data_folder_path = metrics_data_folder_path;
445  this->enable_ml_recognition = enable_ml_recognition;
446  this->page_range = page_range;
447  this->include_pdf_comments = include_pdf_comments;
448  this->word_setting_data = word_setting_data;
449  this->power_point_setting_data = power_point_setting_data;
450  this->excel_setting_data = excel_setting_data;
451  this->enable_trailing_space = enable_trailing_space;
452  this->include_images = include_images;
453  this->timeout = timeout;
454  this->enable_matching_system_fonts = enable_matching_system_fonts;
455  }
456 
467  page_range = data.page_range;
474  timeout = data.timeout;
476  return (*this);
477  }
478 
522  this->metrics_data_folder_path = metrics_data_folder_path;
523  this->enable_ml_recognition = enable_ml_recognition;
524  this->page_range = page_range;
525  this->include_pdf_comments = include_pdf_comments;
526  this->word_setting_data = word_setting_data;
527  this->power_point_setting_data = power_point_setting_data;
528  this->excel_setting_data = excel_setting_data;
529  this->enable_trailing_space = enable_trailing_space;
530  this->include_images = include_images;
531  this->timeout = timeout;
532  this->enable_matching_system_fonts = enable_matching_system_fonts;
533  }
534 
544 
558 
567 
576 
584 
592 
600 
612 
622 
634  int timeout;
635 
644 };
645 
651  public:
657  virtual bool NeedToPause() = 0;
658 
667  virtual void ProgressNotify(int converted_count, int total_count) = 0;
668 };
669 
676  public:
686  virtual bool CheckUserPermissions(uint32 user_permissions) = 0;
687 };
688 
697 class PDF2Office FS_FINAL : public Base {
698  public:
715  static void Initialize(const wchar_t* library_path, const wchar_t* fx_engine_path = L"");
716 
724  static void Release();
725 
733  static String GetVersion();
734 
749  static bool SetConvertCheckCallback(ConvertCheckCallback* convert_check_callback);
750 
773  static common::Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
774  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
775 
799  static common::Progressive StartConvertToWord(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_word_file_stream,
800  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
801 
825  static common::Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
826  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
827 
851  static common::Progressive StartConvertToExcel(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_excel_file_stream,
852  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
853 
876  static common::Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
877  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
878 
902  static common::Progressive StartConvertToPowerPoint(common::file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, common::file::StreamCallback* saved_ppt_file_stream,
903  const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
904 
905 };
906 
907 } // namespace pdf2office
908 } // namespace conversion
909 } // namespace addon
910 } // namespace foxit
911 
912 #endif //defined(WIN32)
913 #endif
static String GetVersion()
获取Foxit PDF转换SDK的版本。
bool enable_generate_page_rendered_break
一个布尔值,指示是否在PDF文档到Word格式文档的转换过程中 在Word格式文档中生成"lastRenderedPageBreak"标记。默认值:false。
Definition: fs_pdf2office.h:154
bool enable_ml_recognition
一个布尔值,指示是否启用基于机器学习的识别功能。默认值:false。
Definition: fs_pdf2office.h:557
WString metrics_data_folder_path
包含度量数据文件的文件夹的有效路径。这不应该是空字符串。
Definition: fs_pdf2office.h:543
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:611
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:221
WorkbookSettings workbook_settings
一个枚举值,指示PDF文档到Excel格式文档转换的工作簿设置。
Definition: fs_pdf2office.h:370
String thousands_separator
一个字符串值,指示在PDF文档到Excel格式文档的转换过程中被识别为千位分隔符的符号。
Definition: fs_pdf2office.h:362
void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
设置值。
Definition: fs_pdf2office.h:327
PDF2PowerPointSettingData & operator=(const PDF2PowerPointSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:200
为每个页面创建工作表。
Definition: fs_pdf2office.h:264
common::Range page_range
一个范围对象,指定某些页面。这些页面将用于将PDF文档转换为Office格式文档。
Definition: fs_pdf2office.h:566
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:66
bool enable_adapt_to_largest_page
一个布尔值,用于指示在将 PDF 文档转换为 PowerPoint 格式时,是否将较小页面的内容适配到最大页面尺寸。 默认值为 false。
Definition: fs_pdf2office.h:247
void Set(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
设置值。
Definition: fs_pdf2office.h:223
文件读取接口。
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:518
PDF2OfficeSettingData()
构造函数。
Definition: fs_pdf2office.h:397
宽字符串类
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:288
int max_blank_paragraphs_per_page_bottom
在将 PDF 文件转换为 Word 文档时,指定每一页底部允许放置的最大空白段落数量。
Definition: fs_pdf2office.h:163
bool enable_generate_footnotes_and_endnotes
一个布尔值,指示是否在PDF文档到Word格式文档的转换过程中 将从PDF文档识别的脚注和尾注转换为Word格式文档的脚注和尾注。默认值:false。
Definition: fs_pdf2office.h:143
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:111
bool include_images
一个布尔值,指示是否在PDF文档到Office格式文档的转换中 包含PDF文档中的图像。默认值:true。
Definition: fs_pdf2office.h:621
bool include_pdf_comments
一个布尔值,指示是否在PDF文档到Office格式文档的转换中 包含PDF文档注释。默认值:true。
Definition: fs_pdf2office.h:575
int timeout
PDF转换超时时间(毫秒)。
Definition: fs_pdf2office.h:634
virtual bool NeedToPause()=0
用于暂停当前转换进度的回调函数。
virtual void ProgressNotify(int converted_count, int total_count)=0
用于通知当前转换进度的回调函数。
为文档创建单个工作表。
Definition: fs_pdf2office.h:260
文件流接口,用于读取和写入。
Definition: fx_stream.h:692
PDF2WordSettingData word_setting_data
用于将PDF文档转换为Word格式文档的设置数据对象。
Definition: fs_pdf2office.h:583
PDF2ExcelSettingData excel_setting_data
用于将PDF文档转换为Excel格式文档的设置数据对象。
Definition: fs_pdf2office.h:599
PDF2WordSettingData & operator=(const PDF2WordSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:81
PDF2OfficeSettingData & operator=(const PDF2OfficeSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:464
Definition: fs_common.h:373
static bool SetConvertCheckCallback(ConvertCheckCallback *convert_check_callback)
设置检查PDF到Office转换条件的回调对象。
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:196
PDF2ExcelSettingData()
构造函数。
Definition: fs_pdf2office.h:268
通用定义和类的头文件。
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:591
Definition: fs_basictypes.h:449
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:440
WorkbookSettings
Excel工作簿设置的枚举。
Definition: fs_pdf2office.h:258
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:170
PDF2PowerPointSettingData(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
带参数的构造函数。
Definition: fs_pdf2office.h:188
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:236
Foxit命名空间。
Definition: fs_taggedpdf.h:27
PDF2WordSettingData()
构造函数。
Definition: fs_pdf2office.h:41
字节字符串类
Definition: fx_string.h:317
bool enable_matching_system_fonts
一个布尔值,用于指示在将 PDF 文档转换为 Office 格式文档时,是否精确匹配系统字体。默认值为false。
Definition: fs_pdf2office.h:643
为每个表格创建工作表。
Definition: fs_pdf2office.h:262
#define NULL
空指针值。
Definition: fx_system.h:792
bool include_watermarks
一个布尔值,指示在将PDF文档转换为Excel格式文档时是否包含水印。默认值:false。
Definition: fs_pdf2office.h:390
bool enable_generate_headers_and_footers
一个布尔值,指示是否在PDF文档到Word格式文档的转换过程中 将从PDF文档识别的页眉和页脚转换为Word格式文档的页眉和页脚。默认值:false。
Definition: fs_pdf2office.h:134
String decimal_symbol
一个字符串值,指示在PDF文档到Excel格式文档的转换过程中被识别为小数点的符号。
Definition: fs_pdf2office.h:347
bool enable_retain_page_layout
一个布尔值,指示是否在PDF文档到Word格式文档的转换中保留页面布局。默认值:false。
Definition: fs_pdf2office.h:125
PDF2ExcelSettingData & operator=(const PDF2ExcelSettingData &data)
赋值操作符。
Definition: fs_pdf2office.h:303
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:380