Foxit PDF Conversion SDK

fs_office2pdf.h
浏览该文件的文档.
1
21 #ifndef FS_OFFICE2PDF_H_
22 #define FS_OFFICE2PDF_H_
23 #if (defined(_WIN32) || defined(_WIN64)) || defined(__linux__)
24
25 #include "common/fs_common.h"
26
32 namespace foxit {
33 using namespace common;
34
35 namespace conversion {
39 namespace office2pdf {
41 class Word2PDFSettingData FS_FINAL : public Object{
42 public:
44 Word2PDFSettingData()
45 : is_generate_bookmark(false) {}
46
52 Word2PDFSettingData(bool is_generate_bookmark) {
53 this->is_generate_bookmark = is_generate_bookmark;
54 }
55
63 Word2PDFSettingData& operator = (const Word2PDFSettingData& data) {
64 is_generate_bookmark = data.is_generate_bookmark;
65 return (*this);
66 }
74 void Set(bool is_generate_bookmark) {
75 this->is_generate_bookmark = is_generate_bookmark;
76 }
77
84 bool is_generate_bookmark;
85 };
86
88 class Excel2PDFSettingData FS_FINAL : public Object{
89 public:
91 Excel2PDFSettingData()
92 : is_separate_workbook(false)
93 , is_output_hidden_worksheets(false) {}
94
102 Excel2PDFSettingData(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names) {
103 this->is_separate_workbook = is_separate_workbook;
104 this->is_output_hidden_worksheets = is_output_hidden_worksheets;
105 this->worksheet_names = worksheet_names;
106 }
107
115 Excel2PDFSettingData & operator = (const Excel2PDFSettingData & data) {
116 is_separate_workbook = data.is_separate_workbook;
117 is_output_hidden_worksheets = data.is_output_hidden_worksheets;
118 worksheet_names = data.worksheet_names;
119 return (*this);
120 }
121
131 void Set(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names) {
132 this->is_separate_workbook = is_separate_workbook;
133 this->is_output_hidden_worksheets = is_output_hidden_worksheets;
134 this->worksheet_names = worksheet_names;
135 }
136
142 bool is_separate_workbook;
143
149 bool is_output_hidden_worksheets;
150
156 foxit::WStringArray worksheet_names;
157 };
158
160 class Office2PDFSettingData FS_FINAL : public Object{
161 public:
163 Office2PDFSettingData()
164 : is_embed_font(false){}
165
176 Office2PDFSettingData(const wchar_t* resource_folder_path, bool is_embed_font, Word2PDFSettingData word_setting_data, Excel2PDFSettingData excel_setting_data) {
177 this->resource_folder_path = resource_folder_path;
178 this->is_embed_font = is_embed_font;
179 this->word_setting_data = word_setting_data;
180 this->excel_setting_data = excel_setting_data;
181 }
182
190 Office2PDFSettingData &operator = (const Office2PDFSettingData& data) {
191 resource_folder_path = data.resource_folder_path;
192 is_embed_font = data.is_embed_font;
193 word_setting_data = data.word_setting_data;
194 excel_setting_data = data.excel_setting_data;
195 return (*this);
196 }
197
210 void Set(const wchar_t* resource_folder_path, bool is_embed_font, Word2PDFSettingData word_setting_data, Excel2PDFSettingData excel_setting_data) {
211 this->resource_folder_path = resource_folder_path;
212 this->is_embed_font = is_embed_font;
213 this->word_setting_data = word_setting_data;
214 this->excel_setting_data = excel_setting_data;
215 }
216
223 WString resource_folder_path;
224
231 bool is_embed_font;
232
239 Word2PDFSettingData word_setting_data;
240
247 Excel2PDFSettingData excel_setting_data;
248 };
249
257 class Office2PDF FS_FINAL : public Base{
258 public:
275 static bool ConvertFromWord(const wchar_t* src_word_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const Office2PDFSettingData& setting_data);
276
297 static bool ConvertFromWord(file::ReaderCallback* src_word_reader, const wchar_t* src_file_password, file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
298
315 static bool ConvertFromExcel(const wchar_t* src_excel_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const Office2PDFSettingData& setting_data);
316
337 static bool ConvertFromExcel(file::ReaderCallback* src_excel_reader, const wchar_t* src_file_password, file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
338
355 static bool ConvertFromPowerPoint(const wchar_t* src_ppt_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const Office2PDFSettingData& setting_data);
356
377 static bool ConvertFromPowerPoint(file::ReaderCallback* src_ppt_reader, const wchar_t* src_file_password, file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
378 };
379 };
380 }
381 }
382 #endif // defined(_WIN32)
383 #endif
foxit::conversion::office2pdf::Excel2PDFSettingData::Excel2PDFSettingData
Excel2PDFSettingData(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names)
带参数的构造函数。
Definition: fs_office2pdf.h:102
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:145
foxit::conversion::office2pdf::Office2PDFSettingData::is_embed_font
bool is_embed_font
一个布尔值，指示是否在转换后的文件中嵌入字体，默认值：false。
Definition: fs_office2pdf.h:231
foxit::WStringArray
Definition: fs_basictypes.h:152
foxit::conversion::office2pdf::Word2PDFSettingData::Set
void Set(bool is_generate_bookmark)
设置值。
Definition: fs_office2pdf.h:74
IFX_FileRead
文件读取接口。
Definition: fx_stream.h:587
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::conversion::office2pdf::Office2PDFSettingData::Office2PDFSettingData
Office2PDFSettingData()
构造函数。
Definition: fs_office2pdf.h:163
foxit::conversion::office2pdf::Excel2PDFSettingData::Set
void Set(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names)
设置值。
Definition: fs_office2pdf.h:131
foxit::conversion::office2pdf::Office2PDFSettingData::word_setting_data
Word2PDFSettingData word_setting_data
用于将Word格式文档转换为PDF格式文档的设置数据对象。
Definition: fs_office2pdf.h:239
foxit::conversion::office2pdf::Excel2PDFSettingData::Excel2PDFSettingData
Excel2PDFSettingData()
构造函数。
Definition: fs_office2pdf.h:91
IFX_FileStream
文件流接口，用于读取和写入。
Definition: fx_stream.h:692
foxit::conversion::office2pdf::Office2PDFSettingData::Set
void Set(const wchar_t *resource_folder_path, bool is_embed_font, Word2PDFSettingData word_setting_data, Excel2PDFSettingData excel_setting_data)
设置值。
Definition: fs_office2pdf.h:210
foxit::conversion::office2pdf::Office2PDFSettingData::excel_setting_data
Excel2PDFSettingData excel_setting_data
用于将Excel格式文档转换为PDF格式文档的设置数据对象。
Definition: fs_office2pdf.h:247
fs_common.h
通用定义和类的头文件。
foxit::conversion::office2pdf::Excel2PDFSettingData::worksheet_names
foxit::WStringArray worksheet_names
要转换为PDF文件的特定工作表名称数组。
Definition: fs_office2pdf.h:156
foxit::conversion::office2pdf::Excel2PDFSettingData::is_separate_workbook
bool is_separate_workbook
一个布尔值，指示是否将工作表导出为单独的PDF文件。
Definition: fs_office2pdf.h:142
foxit::Base
Definition: fs_basictypes.h:232
foxit::conversion::office2pdf::Office2PDFSettingData::Office2PDFSettingData
Office2PDFSettingData(const wchar_t *resource_folder_path, bool is_embed_font, Word2PDFSettingData word_setting_data, Excel2PDFSettingData excel_setting_data)
带参数的构造函数。
Definition: fs_office2pdf.h:176
foxit::conversion::office2pdf::Word2PDFSettingData::Word2PDFSettingData
Word2PDFSettingData()
构造函数。
Definition: fs_office2pdf.h:44
foxit
Foxit 命名空间。
Definition: fs_basictypes.h:124
foxit::conversion::office2pdf::Excel2PDFSettingData::is_output_hidden_worksheets
bool is_output_hidden_worksheets
一个布尔值，指示是否输出隐藏的工作表。
Definition: fs_office2pdf.h:149
foxit::conversion::office2pdf::Office2PDFSettingData::resource_folder_path
WString resource_folder_path
包含资源数据文件的文件夹的有效路径。此参数不应为空字符串。
Definition: fs_office2pdf.h:223
foxit::conversion::office2pdf::Office2PDFSettingData
Definition: fs_office2pdf.h:160
foxit::conversion::office2pdf::Excel2PDFSettingData
Definition: fs_office2pdf.h:88
foxit::conversion::office2pdf::Office2PDF
Definition: fs_office2pdf.h:257
foxit::conversion::office2pdf::Word2PDFSettingData::is_generate_bookmark
bool is_generate_bookmark
一个布尔值，指示是否将书签导出到转换后的PDF文件。
Definition: fs_office2pdf.h:84
foxit::conversion::office2pdf::Word2PDFSettingData
Definition: fs_office2pdf.h:41
foxit::conversion::office2pdf::Word2PDFSettingData::Word2PDFSettingData
Word2PDFSettingData(bool is_generate_bookmark)
带参数的构造函数。
Definition: fs_office2pdf.h:52