Foxit PDF Conversion SDK

fs_office2pdf.h
Go to the documentation of this file.
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:
276 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);
277
299 static bool ConvertFromWord(file::ReaderCallback* src_word_reader, const wchar_t* src_file_password, file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
300
318 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);
319
341 static bool ConvertFromExcel(file::ReaderCallback* src_excel_reader, const wchar_t* src_file_password, file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
342
360 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);
361
383 static bool ConvertFromPowerPoint(file::ReaderCallback* src_ppt_reader, const wchar_t* src_file_password, file::StreamCallback* saved_pdf_file_stream, const Office2PDFSettingData& setting_data);
384 };
385 };
386 }
387 }
388 #endif // defined(_WIN32)
389 #endif
foxit::conversion::office2pdf::Excel2PDFSettingData::Excel2PDFSettingData
Excel2PDFSettingData(bool is_separate_workbook, bool is_output_hidden_worksheets, foxit::WStringArray worksheet_names)
Constructor, with parameters.
Definition: fs_office2pdf.h:102
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:145
foxit::conversion::office2pdf::Office2PDFSettingData::is_embed_font
bool is_embed_font
A boolean value which indicates whether to embed font in the converted file,Default value: false.
Definition: fs_office2pdf.h:231
foxit::WStringArray
Definition: fs_basictypes.h:152
foxit::conversion::office2pdf::Word2PDFSettingData::Set
void Set(bool is_generate_bookmark)
Set value.
Definition: fs_office2pdf.h:74
IFX_FileRead
File reading interface.
Definition: fx_stream.h:566
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1452
foxit::conversion::office2pdf::Office2PDFSettingData::Office2PDFSettingData
Office2PDFSettingData()
Constructor.
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)
Set value.
Definition: fs_office2pdf.h:131
foxit::conversion::office2pdf::Office2PDFSettingData::word_setting_data
Word2PDFSettingData word_setting_data
A setting data object that used for converting Word format documents to PDF format documents.
Definition: fs_office2pdf.h:239
foxit::conversion::office2pdf::Excel2PDFSettingData::Excel2PDFSettingData
Excel2PDFSettingData()
Constructor.
Definition: fs_office2pdf.h:91
IFX_FileStream
File stream interface, reading & writing.
Definition: fx_stream.h:669
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)
Set value.
Definition: fs_office2pdf.h:210
foxit::conversion::office2pdf::Office2PDFSettingData::excel_setting_data
Excel2PDFSettingData excel_setting_data
A setting data object that used for converting Excel format documents to PDF format documents.
Definition: fs_office2pdf.h:247
fs_common.h
Header file for common definitions and classes.
foxit::conversion::office2pdf::Excel2PDFSettingData::worksheet_names
foxit::WStringArray worksheet_names
An array of specific worksheet names to be converted to PDF files.
Definition: fs_office2pdf.h:156
foxit::conversion::office2pdf::Excel2PDFSettingData::is_separate_workbook
bool is_separate_workbook
A boolean value which indicates whether to export worksheets to separate PDF files.
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)
Constructor, with parameters.
Definition: fs_office2pdf.h:176
foxit::conversion::office2pdf::Word2PDFSettingData::Word2PDFSettingData
Word2PDFSettingData()
Constructor.
Definition: fs_office2pdf.h:44
foxit
Foxit namespace.
Definition: fs_basictypes.h:124
foxit::conversion::office2pdf::Excel2PDFSettingData::is_output_hidden_worksheets
bool is_output_hidden_worksheets
A boolean value which indicates whether to output the hidden worksheets.
Definition: fs_office2pdf.h:149
foxit::conversion::office2pdf::Office2PDFSettingData::resource_folder_path
WString resource_folder_path
A valid path of a folder which contains resource data files. This should not be an empty string.
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
A boolean value which indicates whether to export bookmarks to converted PDF file.
Definition: fs_office2pdf.h:84
foxit::conversion::office2pdf::Word2PDFSettingData
Definition: fs_office2pdf.h:41
foxit::conversion::office2pdf::Word2PDFSettingData::Word2PDFSettingData
Word2PDFSettingData(bool is_generate_bookmark)
Constructor, with parameters.
Definition: fs_office2pdf.h:52