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__)
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::addon::conversion::office2pdf::Office2PDFSettingData
Definition: fs_office2pdf.h:157
foxit::addon::conversion::office2pdf::Word2PDFConfig::Word2PDFConfig
Word2PDFConfig()
构造函数。
Definition: fs_office2pdf.h:41
foxit::addon::conversion::office2pdf::Excel2PDFConfig::Excel2PDFConfig
Excel2PDFConfig()
构造函数。
Definition: fs_office2pdf.h:88
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
foxit::addon::conversion::office2pdf::Excel2PDFConfig::operator=
Excel2PDFConfig & operator=(const Excel2PDFConfig &data)
赋值操作符。
Definition: fs_office2pdf.h:112
foxit::addon::conversion::office2pdf::Word2PDFConfig
Definition: fs_office2pdf.h:38
foxit::addon::conversion::office2pdf::Office2PDF::GetVersion
static String GetVersion()
获取Foxit PDF转换SDK的版本。
foxit::WStringArray
Definition: fs_basictypes.h:227
foxit::addon::conversion::office2pdf::Excel2PDFConfig::is_output_hidden_worksheets
bool is_output_hidden_worksheets
一个布尔值，指示是否输出隐藏的工作表。
Definition: fs_office2pdf.h:146
IFX_FileRead
文件读取接口。
Definition: fx_stream.h:587
foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromWord
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)
将Word格式文件转换为PDF文件。
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::addon::conversion::office2pdf::Word2PDFConfig::Set
void Set(bool is_generate_bookmark)
设置值。
Definition: fs_office2pdf.h:71
foxit::addon::conversion::office2pdf::Office2PDFSettingData::is_embed_font
bool is_embed_font
一个布尔值，指示是否在转换后的文件中嵌入字体，默认值：false。
Definition: fs_office2pdf.h:229
foxit::addon::conversion::office2pdf::Office2PDFSettingData::Office2PDFSettingData
Office2PDFSettingData(const wchar_t *resource_folder_path, bool is_embed_font, Word2PDFConfig word_setting_data, Excel2PDFConfig excel_setting_data)
带参数的构造函数。
Definition: fs_office2pdf.h:173
foxit::addon::conversion::office2pdf::Excel2PDFConfig::is_separate_workbook
bool is_separate_workbook
一个布尔值，指示是否将工作表导出到单独的PDF文件。
Definition: fs_office2pdf.h:139
foxit::addon::conversion::office2pdf::Office2PDFSettingData::Office2PDFSettingData
Office2PDFSettingData()
构造函数。
Definition: fs_office2pdf.h:160
foxit::addon::conversion::office2pdf::Office2PDFSettingData::Set
void Set(const wchar_t *resource_folder_path, bool is_embed_font, Word2PDFConfig word_setting_data, Excel2PDFConfig excel_setting_data)
设置值。
Definition: fs_office2pdf.h:207
foxit::addon::conversion::office2pdf::Excel2PDFConfig
Definition: fs_office2pdf.h:85
IFX_FileStream
文件流接口，用于读取和写入。
Definition: fx_stream.h:692
foxit::addon::conversion::office2pdf::Excel2PDFConfig::Set
void Set(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names)
设置值。
Definition: fs_office2pdf.h:128
foxit::addon::conversion::office2pdf::Office2PDFSettingData::excel_setting_data
Excel2PDFConfig excel_setting_data
用于将Excel格式文档转换为PDF格式文档的设置数据对象。
Definition: fs_office2pdf.h:245
foxit::addon::conversion::office2pdf::Office2PDF::Initialize
static void Initialize(const wchar_t *library_path)
初始化Foxit PDF转换。
fs_common.h
通用定义和类的头文件。
foxit::addon::conversion::office2pdf::Office2PDFSettingData::operator=
Office2PDFSettingData & operator=(const Office2PDFSettingData &data)
赋值操作符。
Definition: fs_office2pdf.h:187
foxit::addon::conversion::office2pdf::Office2PDFSettingData::resource_folder_path
WString resource_folder_path
包含资源数据文件的文件夹的有效路径。这不应该是空字符串。
Definition: fs_office2pdf.h:220
foxit::addon::conversion::office2pdf::Excel2PDFConfig::worksheet_names
foxit::WStringArray worksheet_names
要转换为PDF文件的特定工作表名称数组。
Definition: fs_office2pdf.h:153
foxit::addon::conversion::office2pdf::Excel2PDFConfig::Excel2PDFConfig
Excel2PDFConfig(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names)
带参数的构造函数。
Definition: fs_office2pdf.h:99
foxit::Base
Definition: fs_basictypes.h:465
foxit::addon::conversion::office2pdf::Office2PDF
Definition: fs_office2pdf.h:257
foxit::addon::conversion::office2pdf::Word2PDFConfig::Word2PDFConfig
Word2PDFConfig(bool is_generate_bookmark)
带参数的构造函数。
Definition: fs_office2pdf.h:49
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::addon::conversion::office2pdf::Office2PDF::Release
static void Release()
释放Foxit PDF转换分配的所有资源。
foxit::addon::conversion::office2pdf::Word2PDFConfig::is_generate_bookmark
bool is_generate_bookmark
一个布尔值，指示是否将书签导出到转换后的PDF文件。
Definition: fs_office2pdf.h:81
foxit::addon::conversion::office2pdf::Word2PDFConfig::operator=
Word2PDFConfig & operator=(const Word2PDFConfig &data)
赋值操作符。
Definition: fs_office2pdf.h:60
foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromExcel
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)
将Excel格式文件转换为PDF文件。
foxit::addon::conversion::office2pdf::Office2PDF::ConvertFromPowerPoint
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)
将PowerPoint格式文件转换为PDF文件。
foxit::addon::conversion::office2pdf::Office2PDFSettingData::word_setting_data
Word2PDFConfig word_setting_data
用于将Word格式文档转换为PDF格式文档的设置数据对象。
Definition: fs_office2pdf.h:237