Foxit PDF Conversion SDK

fs_pdf2office.h
浏览该文件的文档.
1
15 #ifndef FS_CONVERT_H_
16 #define FS_CONVERT_H_
17
18 #include "common/fs_common.h"
19
25 namespace foxit {
26 using namespace common;
30 namespace conversion {
34 namespace pdf2office {
36 class PDF2WordSettingData FS_FINAL : public Object{
37 public:
39 PDF2WordSettingData()
40 : enable_retain_page_layout(false)
41 , enable_generate_headers_and_footers(true)
42 , enable_generate_footnotes_and_endnotes(false)
43 , enable_generate_page_rendered_break(false)
44 , max_blank_paragraphs_per_page_bottom(0){ }
45
63 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) {
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 this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
68 this->max_blank_paragraphs_per_page_bottom = max_blank_paragraphs_per_page_bottom;
69 }
70
78 PDF2WordSettingData & operator = (const PDF2WordSettingData & data) {
79 enable_retain_page_layout = data.enable_retain_page_layout;
80 enable_generate_headers_and_footers = data.enable_generate_headers_and_footers;
81 enable_generate_footnotes_and_endnotes = data.enable_generate_footnotes_and_endnotes;
82 enable_generate_page_rendered_break = data.enable_generate_page_rendered_break;
83 max_blank_paragraphs_per_page_bottom = data.max_blank_paragraphs_per_page_bottom;
84 return (*this);
85 }
86
106 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, int max_blank_paragraphs_per_page_bottom) {
107 this->enable_retain_page_layout = enable_retain_page_layout;
108 this->enable_generate_headers_and_footers = enable_generate_headers_and_footers;
109 this->enable_generate_footnotes_and_endnotes = enable_generate_footnotes_and_endnotes;
110 this->enable_generate_page_rendered_break = enable_generate_page_rendered_break;
111 this->max_blank_paragraphs_per_page_bottom = max_blank_paragraphs_per_page_bottom;
112 }
113
120 bool enable_retain_page_layout;
121
131 bool enable_generate_headers_and_footers;
132
140 bool enable_generate_footnotes_and_endnotes;
141
151 bool enable_generate_page_rendered_break;
152
161 int max_blank_paragraphs_per_page_bottom;
162 };
163
165 class PDF2PowerPointSettingData FS_FINAL : public Object{
166 public:
168 PDF2PowerPointSettingData()
169 : enable_aggressively_split_sections(false)
170 , enable_adapt_to_largest_page(false) { }
171
188 PDF2PowerPointSettingData(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page) {
189 this->enable_aggressively_split_sections = enable_aggressively_split_sections;
190 this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
191 }
192
200 PDF2PowerPointSettingData & operator = (const PDF2PowerPointSettingData & data) {
201 enable_aggressively_split_sections = data.enable_aggressively_split_sections;
202 enable_adapt_to_largest_page = data.enable_adapt_to_largest_page;
203 return (*this);
204 }
205
224 void Set(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page) {
225 this->enable_aggressively_split_sections = enable_aggressively_split_sections;
226 this->enable_adapt_to_largest_page = enable_adapt_to_largest_page;
227 }
228
237 bool enable_aggressively_split_sections;
238
249 bool enable_adapt_to_largest_page;
250 };
251
253 class PDF2ExcelSettingData FS_FINAL : public Object {
254 public:
260 typedef enum _WorkbookSettings {
262 e_WorkbookSettingsDocument = 0,
264 e_WorkbookSettingsEachTable = 1,
266 e_WorkbookSettingsEachPage = 2
267 } WorkbookSettings;
268
270 PDF2ExcelSettingData()
271 : decimal_symbol("")
272 , thousands_separator("")
273 , workbook_settings(PDF2ExcelSettingData::e_WorkbookSettingsEachPage)
274 , enable_aggressive_table_repair(true)
275 , include_watermarks(false){ }
276
290 PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks) {
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
305 PDF2ExcelSettingData& operator = (const PDF2ExcelSettingData& data) {
306 this->decimal_symbol = data.decimal_symbol;
307 this->thousands_separator = data.thousands_separator;
308 this->workbook_settings = data.workbook_settings;
309 this->enable_aggressive_table_repair = data.enable_aggressive_table_repair;
310 this->include_watermarks = data.include_watermarks;
311 return (*this);
312 }
313
329 void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks) {
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 String decimal_symbol;
351
366 String thousands_separator;
367
374 WorkbookSettings workbook_settings;
375
384 bool enable_aggressive_table_repair;
385
394 bool include_watermarks;
395 };
396
398 class PDF2OfficeSettingData FS_FINAL : public Object {
399 public:
401 PDF2OfficeSettingData()
402 : enable_ml_recognition(false)
403 , include_pdf_comments(true)
404 , enable_trailing_space(true)
405 , include_images(true)
406 , enable_matching_system_fonts(false) { }
407
442 PDF2OfficeSettingData(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const Range& page_range, bool include_pdf_comments,
443 const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
444 const PDF2ExcelSettingData& excel_setting_data, bool enable_trailing_space, bool include_images, bool enable_matching_system_fonts) {
445 this->metrics_data_folder_path = metrics_data_folder_path;
446 this->enable_ml_recognition = enable_ml_recognition;
447 this->page_range = page_range;
448 this->include_pdf_comments = include_pdf_comments;
449 this->word_setting_data = word_setting_data;
450 this->power_point_setting_data = power_point_setting_data;
451 this->excel_setting_data = excel_setting_data;
452 this->enable_trailing_space = enable_trailing_space;
453 this->include_images = include_images;
454 this->enable_matching_system_fonts = enable_matching_system_fonts;
455 }
456
464 PDF2OfficeSettingData &operator = (const PDF2OfficeSettingData& data) {
465 metrics_data_folder_path = data.metrics_data_folder_path;
466 enable_ml_recognition = data.enable_ml_recognition;
467 page_range = data.page_range;
468 include_pdf_comments = data.include_pdf_comments;
469 word_setting_data = data.word_setting_data;
470 power_point_setting_data = data.power_point_setting_data;
471 excel_setting_data = data.excel_setting_data;
472 enable_trailing_space = data.enable_trailing_space;
473 include_images = data.include_images;
474 enable_matching_system_fonts = data.enable_matching_system_fonts;
475 return (*this);
476 }
477
514 void Set(const wchar_t* metrics_data_folder_path, bool enable_ml_recognition, const Range &page_range, bool include_pdf_comments,
515 const PDF2WordSettingData& word_setting_data, const PDF2PowerPointSettingData& power_point_setting_data,
516 const PDF2ExcelSettingData& excel_setting_data, bool enable_trailing_space, bool include_images, bool enable_matching_system_fonts) {
517 this->metrics_data_folder_path = metrics_data_folder_path;
518 this->enable_ml_recognition = enable_ml_recognition;
519 this->page_range = page_range;
520 this->include_pdf_comments = include_pdf_comments;
521 this->word_setting_data = word_setting_data;
522 this->power_point_setting_data = power_point_setting_data;
523 this->excel_setting_data = excel_setting_data;
524 this->enable_trailing_space = enable_trailing_space;
525 this->include_images = include_images;
526 this->enable_matching_system_fonts = enable_matching_system_fonts;
527 }
528
537 WString metrics_data_folder_path;
538
551 bool enable_ml_recognition;
552
560 Range page_range;
561
569 bool include_pdf_comments;
570
577 PDF2WordSettingData word_setting_data;
578
585 PDF2PowerPointSettingData power_point_setting_data;
586
593 PDF2ExcelSettingData excel_setting_data;
594
604 bool enable_trailing_space;
605
614 bool include_images;
615
624 bool enable_matching_system_fonts;
625 };
626
631 class ConvertCallback {
632 public:
638 virtual bool NeedToPause() = 0;
639
648 virtual void ProgressNotify(int converted_count, int total_count) = 0;
649 };
650
659 class PDF2Office FS_FINAL : public Base {
660 public:
688 static Progressive StartConvertToWord(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_word_file_path,
689 const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
690
719 static Progressive StartConvertToWord(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_word_file_stream,
720 const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
721
748 static Progressive StartConvertToExcel(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_excel_file_path,
749 const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
750
778 static Progressive StartConvertToExcel(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_excel_file_stream,
779 const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
780
807 static Progressive StartConvertToPowerPoint(const wchar_t* src_pdf_path, const wchar_t* src_pdf_password, const wchar_t* saved_ppt_file_path,
808 const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
809
837 static Progressive StartConvertToPowerPoint(file::ReaderCallback* src_pdf_reader, const wchar_t* src_pdf_password, file::StreamCallback* saved_ppt_file_stream,
838 const PDF2OfficeSettingData& setting_data, ConvertCallback* convert_callback = NULL);
839 };
840 } // namespace pdf2office
841 } // namespace conversion
842 } // namespace foxit
843
844 #endif
foxit::conversion::pdf2office::PDF2WordSettingData::PDF2WordSettingData
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:63
foxit::conversion::pdf2office::PDF2PowerPointSettingData::PDF2PowerPointSettingData
PDF2PowerPointSettingData()
构造函数。
Definition: fs_pdf2office.h:168
foxit::common::Range
Definition: fs_common.h:269
foxit::conversion::pdf2office::PDF2PowerPointSettingData
Definition: fs_pdf2office.h:165
foxit::conversion::pdf2office::PDF2OfficeSettingData
Definition: fs_pdf2office.h:398
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:145
foxit::conversion::pdf2office::PDF2WordSettingData
Definition: fs_pdf2office.h:36
foxit::conversion::pdf2office::PDF2WordSettingData::max_blank_paragraphs_per_page_bottom
int max_blank_paragraphs_per_page_bottom
指定将PDF文件转换为Word文档时，每个页面底部可以放置的最大空白段落数。
Definition: fs_pdf2office.h:161
IFX_FileRead
文件读取接口。
Definition: fx_stream.h:587
foxit::conversion::pdf2office::PDF2OfficeSettingData::enable_trailing_space
bool enable_trailing_space
一个布尔值，指示在将PDF文档转换为Office格式文档时 是否从段落中的行添加尾随空格。默认值：true。
Definition: fs_pdf2office.h:604
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::conversion::pdf2office::PDF2OfficeSettingData::word_setting_data
PDF2WordSettingData word_setting_data
用于将PDF文档转换为Word格式文档的设置数据对象。
Definition: fs_pdf2office.h:577
foxit::conversion::pdf2office::PDF2PowerPointSettingData::enable_aggressively_split_sections
bool enable_aggressively_split_sections
一个布尔值，指示在将PDF文档转换为PowerPoint格式文档时是否积极拆分节。默认值：false。
Definition: fs_pdf2office.h:237
foxit::conversion::pdf2office::PDF2WordSettingData::enable_generate_headers_and_footers
bool enable_generate_headers_and_footers
一个布尔值，指示在将PDF文档转换为Word格式文档过程中，是否将PDF文档中识别出的页眉和页脚 转换为Word格式文档的页眉和页脚。默认值：true。
Definition: fs_pdf2office.h:131
foxit::conversion::pdf2office::PDF2ExcelSettingData::PDF2ExcelSettingData
PDF2ExcelSettingData(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
带参数的构造函数。
Definition: fs_pdf2office.h:290
foxit::conversion::pdf2office::PDF2OfficeSettingData::PDF2OfficeSettingData
PDF2OfficeSettingData(const wchar_t *metrics_data_folder_path, bool enable_ml_recognition, const 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, bool enable_matching_system_fonts)
带参数的构造函数。
Definition: fs_pdf2office.h:442
foxit::conversion::pdf2office::PDF2ExcelSettingData::thousands_separator
String thousands_separator
一个字符串值，指示在将PDF文档转换为Excel格式文档时被识别为千位分隔符。
Definition: fs_pdf2office.h:366
foxit::conversion::pdf2office::PDF2WordSettingData::enable_generate_page_rendered_break
bool enable_generate_page_rendered_break
一个布尔值，指示在将PDF文档转换为Word格式文档过程中，是否在Word格式文档中 生成"lastRenderedPageBreak"标记。默认值：false。
Definition: fs_pdf2office.h:151
foxit::conversion::pdf2office::PDF2OfficeSettingData::excel_setting_data
PDF2ExcelSettingData excel_setting_data
用于将PDF文档转换为Excel格式文档的设置数据对象。
Definition: fs_pdf2office.h:593
foxit::conversion::pdf2office::PDF2OfficeSettingData::metrics_data_folder_path
WString metrics_data_folder_path
包含度量数据文件的文件夹的有效路径。此参数不应为空字符串。
Definition: fs_pdf2office.h:537
foxit::conversion::pdf2office::PDF2PowerPointSettingData::Set
void Set(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
设置值。
Definition: fs_pdf2office.h:224
IFX_FileStream
文件流接口，用于读取和写入。
Definition: fx_stream.h:692
foxit::conversion::pdf2office::PDF2PowerPointSettingData::enable_adapt_to_largest_page
bool enable_adapt_to_largest_page
一个布尔值，指示在将PDF文档转换为PowerPoint格式过程中，是否将较小页面的内容适应为最大页面尺寸。默认值：false。
Definition: fs_pdf2office.h:249
foxit::conversion::pdf2office::PDF2OfficeSettingData::power_point_setting_data
PDF2PowerPointSettingData power_point_setting_data
用于将PDF文档转换为PowerPoint格式文档的设置数据对象。
Definition: fs_pdf2office.h:585
foxit::conversion::pdf2office::PDF2ExcelSettingData::enable_aggressive_table_repair
bool enable_aggressive_table_repair
一个布尔值，指示在将PDF文档转换为Excel格式文档时是否启用强化表格修复。默认值：true。
Definition: fs_pdf2office.h:384
foxit::common::Progressive
Definition: fs_common.h:206
foxit::conversion::pdf2office::PDF2ExcelSettingData::WorkbookSettings
WorkbookSettings
Excel工作簿设置的枚举。
Definition: fs_pdf2office.h:260
fs_common.h
通用定义和类的头文件。
foxit::conversion::pdf2office::PDF2OfficeSettingData::Set
void Set(const wchar_t *metrics_data_folder_path, bool enable_ml_recognition, const 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, bool enable_matching_system_fonts)
设置值。
Definition: fs_pdf2office.h:514
foxit::conversion::pdf2office::PDF2WordSettingData::PDF2WordSettingData
PDF2WordSettingData()
构造函数。
Definition: fs_pdf2office.h:39
foxit::conversion::pdf2office::PDF2WordSettingData::enable_retain_page_layout
bool enable_retain_page_layout
一个布尔值，指示在将PDF文档转换为Word格式文档时是否保留页面布局。默认值：false。
Definition: fs_pdf2office.h:120
foxit::conversion::pdf2office::PDF2ExcelSettingData::decimal_symbol
String decimal_symbol
一个字符串值，指示在将PDF文档转换为Excel格式文档时被识别为小数点。
Definition: fs_pdf2office.h:350
foxit::conversion::pdf2office::PDF2OfficeSettingData::include_images
bool include_images
一个布尔值，指示在将PDF文档转换为Office格式文档时 是否包含PDF文档中的图像。默认值：true。
Definition: fs_pdf2office.h:614
foxit::Base
Definition: fs_basictypes.h:232
foxit::conversion::pdf2office::PDF2ExcelSettingData
Definition: fs_pdf2office.h:253
foxit::conversion::pdf2office::PDF2ExcelSettingData::PDF2ExcelSettingData
PDF2ExcelSettingData()
构造函数。
Definition: fs_pdf2office.h:270
foxit
Foxit 命名空间。
Definition: fs_basictypes.h:124
foxit::conversion::pdf2office::PDF2ExcelSettingData::workbook_settings
WorkbookSettings workbook_settings
一个枚举值，指示将PDF文档转换为Excel格式文档时工作簿的设置。
Definition: fs_pdf2office.h:374
foxit::conversion::pdf2office::PDF2Office
Definition: fs_pdf2office.h:659
foxit::conversion::pdf2office::PDF2ExcelSettingData::Set
void Set(String decimal_symbol, String thousands_separator, WorkbookSettings workbook_settings, bool enable_aggressive_table_repair, bool include_watermarks)
设置值。
Definition: fs_pdf2office.h:329
foxit::conversion::pdf2office::PDF2ExcelSettingData::include_watermarks
bool include_watermarks
一个布尔值，指示在将PDF文档转换为Excel格式文档时是否包含水印。默认值：false。
Definition: fs_pdf2office.h:394
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::conversion::pdf2office::PDF2OfficeSettingData::include_pdf_comments
bool include_pdf_comments
一个布尔值，指示在将PDF文档转换为Office格式文档时 是否包含PDF文档注释。默认值：true。
Definition: fs_pdf2office.h:569
foxit::conversion::pdf2office::ConvertCallback
Definition: fs_pdf2office.h:631
foxit::conversion::pdf2office::PDF2WordSettingData::enable_generate_footnotes_and_endnotes
bool enable_generate_footnotes_and_endnotes
一个布尔值，指示在将PDF文档转换为Word格式文档过程中，是否将PDF文档中识别出的脚注和尾注 转换为Word格式文档的脚注和尾注。默认值：false。
Definition: fs_pdf2office.h:140
foxit::conversion::pdf2office::PDF2WordSettingData::Set
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, int max_blank_paragraphs_per_page_bottom)
设置值。
Definition: fs_pdf2office.h:106
NULL
#define NULL
空指针值。
Definition: fx_system.h:792
foxit::conversion::pdf2office::PDF2OfficeSettingData::PDF2OfficeSettingData
PDF2OfficeSettingData()
构造函数。
Definition: fs_pdf2office.h:401
foxit::conversion::pdf2office::PDF2OfficeSettingData::enable_matching_system_fonts
bool enable_matching_system_fonts
一个布尔值，指示在将PDF文档转换为Office格式文档时 是否准确匹配系统字体。默认值：false。
Definition: fs_pdf2office.h:624
foxit::conversion::pdf2office::PDF2OfficeSettingData::page_range
Range page_range
指定某些页面的范围对象。这些页面将用于将PDF文档转换为Office格式文档。
Definition: fs_pdf2office.h:560
foxit::conversion::pdf2office::PDF2OfficeSettingData::enable_ml_recognition
bool enable_ml_recognition
一个布尔值，指示是否启用基于机器学习的识别功能。默认值：false。
Definition: fs_pdf2office.h:551
foxit::conversion::pdf2office::PDF2PowerPointSettingData::PDF2PowerPointSettingData
PDF2PowerPointSettingData(bool enable_aggressively_split_sections, bool enable_adapt_to_largest_page)
带参数的构造函数。
Definition: fs_pdf2office.h:188