Foxit PDF SDK

fs_office2pdf.h
浏览该文件的文档.
1
14 #ifndef FS_OFFICE2PDF_H_
15 #define FS_OFFICE2PDF_H_
16 #if defined(_WIN32) || defined(_WIN64) || (defined(__linux__) && (defined(__i386__) || defined(__x86_64__)) && !defined(__ANDROID__))
17 #include "common/fs_common.h"
18
24 namespace foxit {
28 namespace addon {
32 namespace conversion {
36 namespace office2pdf {
38 class Word2PDFConfig FS_FINAL : public Object{
39 public:
41 Word2PDFConfig()
42 : is_generate_bookmark(false) {}
43
49 Word2PDFConfig(bool is_generate_bookmark) {
50 this->is_generate_bookmark = is_generate_bookmark;
51 }
52
60 Word2PDFConfig & operator = (const Word2PDFConfig & data) {
61 is_generate_bookmark = data.is_generate_bookmark;
62 return (*this);
63 }
64
71 void Set(bool is_generate_bookmark) {
72 this->is_generate_bookmark = is_generate_bookmark;
73 }
74
81 bool is_generate_bookmark;
82 };
83
85 class Excel2PDFConfig FS_FINAL : public Object{
86 public:
88 Excel2PDFConfig()
89 : is_separate_workbook(false)
90 , is_output_hidden_worksheets(false) {}
91
99 Excel2PDFConfig(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names) {
100 this->is_separate_workbook = is_separate_workbook;
101 this->is_output_hidden_worksheets = is_output_hidden_worksheets;
102 this->worksheet_names = worksheet_names;
103 }
104
112 Excel2PDFConfig & operator = (const Excel2PDFConfig & data) {
113 is_separate_workbook = data.is_separate_workbook;
114 is_output_hidden_worksheets = data.is_output_hidden_worksheets;
115 worksheet_names = data.worksheet_names;
116 return (*this);
117 }
118
128 void Set(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names) {
129 this->is_separate_workbook = is_separate_workbook;
130 this->is_output_hidden_worksheets = is_output_hidden_worksheets;
131 this->worksheet_names = worksheet_names;
132 }
133
139 bool is_separate_workbook;
140
146 bool is_output_hidden_worksheets;
147
153 foxit::WStringArray worksheet_names;
154 };
155
157 class Office2PDFSettingData FS_FINAL : public Object{
158 public:
160 Office2PDFSettingData()
161 : is_embed_font(false){}
162
173 Office2PDFSettingData(const wchar_t* resource_folder_path, bool is_embed_font, Word2PDFConfig word_setting_data, Excel2PDFConfig excel_setting_data) {
174 this->resource_folder_path = resource_folder_path;
175 this->is_embed_font = is_embed_font;
176 this->word_setting_data = word_setting_data;
177 this->excel_setting_data = excel_setting_data;
178 }
179
187 Office2PDFSettingData &operator = (const Office2PDFSettingData& data) {
188 resource_folder_path = data.resource_folder_path;
189 is_embed_font = data.is_embed_font;
190 word_setting_data = data.word_setting_data;
191 excel_setting_data = data.excel_setting_data;
192 return (*this);
193 }
194
207 void Set(const wchar_t* resource_folder_path, bool is_embed_font, Word2PDFConfig word_setting_data, Excel2PDFConfig excel_setting_data) {
208 this->resource_folder_path = resource_folder_path;
209 this->is_embed_font = is_embed_font;
210 this->word_setting_data = word_setting_data;
211 this->excel_setting_data = excel_setting_data;
212 }
213
220 WString resource_folder_path;
221
229 bool is_embed_font;
230
237 Word2PDFConfig word_setting_data;
238
245 Excel2PDFConfig excel_setting_data;
246 };
247
257 class Office2PDF FS_FINAL : public Base{
258 public:
273 static void Initialize(const wchar_t* library_path);
274
282 static void Release();
283
291 static String GetVersion();
292
306 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);
307
325 static bool ConvertFromWord(common::file::ReaderCallback* src_word_reader, const wchar_t* src_file_password, common::file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
326
340 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);
341
358 static bool ConvertFromExcel(common::file::ReaderCallback* src_excel_reader, const wchar_t* src_file_password, common::file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
359
373 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);
374
391 static bool ConvertFromPowerPoint(common::file::ReaderCallback* src_ppt_reader, const wchar_t* src_file_password, common::file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
392 };
393 } // namespace office2pdf
394 } // namespace conversion
395 } // namespace addon
396 } // namespace foxit
397
398 #endif //defined(_WIN32) || defined(_WIN64)
399 #endif
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:221
fs_common.h
通用定义和类的头文件。
foxit::WString
CFX_WideString WString
宽字符串。
Definition: fs_basictypes.h:223
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::common::file::StreamCallback
IFX_FileStream StreamCallback
Definition: fs_file.h:54
foxit::common::file::ReaderCallback
IFX_FileRead ReaderCallback
Definition: fs_file.h:40
foxit::WStringArray
Definition: fs_basictypes.h:228
foxit::String
CFX_ByteString String
字节字符串。
Definition: fs_basictypes.h:225