Foxit PDF SDK

fs_office2pdf.h
Go to the documentation of this file.
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
228 bool is_embed_font;
229
236 Word2PDFConfig word_setting_data;
237
244 Excel2PDFConfig excel_setting_data;
245 };
246
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()
Constructor.
Definition: fs_office2pdf.h:41
foxit::addon::conversion::office2pdf::Excel2PDFConfig::Excel2PDFConfig
Excel2PDFConfig()
Constructor.
Definition: fs_office2pdf.h:88
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:220
foxit::addon::conversion::office2pdf::Excel2PDFConfig::operator=
Excel2PDFConfig & operator=(const Excel2PDFConfig &data)
Assign operator.
Definition: fs_office2pdf.h:112
foxit::addon::conversion::office2pdf::Word2PDFConfig
Definition: fs_office2pdf.h:38
foxit::addon::conversion::office2pdf::Office2PDF::GetVersion
static String GetVersion()
Get the version of Foxit PDF Conversion SDK.
foxit::WStringArray
Definition: fs_basictypes.h:227
foxit::addon::conversion::office2pdf::Excel2PDFConfig::is_output_hidden_worksheets
bool is_output_hidden_worksheets
A boolean value which indicates whether to output the hidden worksheets.
Definition: fs_office2pdf.h:146
IFX_FileRead
File reading interface.
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)
Convert a Word format file to a PDF file.
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::addon::conversion::office2pdf::Word2PDFConfig::Set
void Set(bool is_generate_bookmark)
Set value.
Definition: fs_office2pdf.h:71
foxit::addon::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:228
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)
Constructor, with parameters.
Definition: fs_office2pdf.h:173
foxit::addon::conversion::office2pdf::Excel2PDFConfig::is_separate_workbook
bool is_separate_workbook
A boolean value which indicates whether to export worksheets to separate PDF files.
Definition: fs_office2pdf.h:139
foxit::addon::conversion::office2pdf::Office2PDFSettingData::Office2PDFSettingData
Office2PDFSettingData()
Constructor.
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)
Set value.
Definition: fs_office2pdf.h:207
foxit::addon::conversion::office2pdf::Excel2PDFConfig
Definition: fs_office2pdf.h:85
IFX_FileStream
File stream interface, reading & writing.
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)
Set value.
Definition: fs_office2pdf.h:128
foxit::addon::conversion::office2pdf::Office2PDFSettingData::excel_setting_data
Excel2PDFConfig excel_setting_data
A setting data object that used for converting Excel format documents to PDF format documents.
Definition: fs_office2pdf.h:244
foxit::addon::conversion::office2pdf::Office2PDF::Initialize
static void Initialize(const wchar_t *library_path)
Initialize Foxit PDF Conversion.
fs_common.h
Header file for common definitions and classes.
foxit::addon::conversion::office2pdf::Office2PDFSettingData::operator=
Office2PDFSettingData & operator=(const Office2PDFSettingData &data)
Assign operator.
Definition: fs_office2pdf.h:187
foxit::addon::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:220
foxit::addon::conversion::office2pdf::Excel2PDFConfig::worksheet_names
foxit::WStringArray worksheet_names
An array of specific worksheet names to be converted to PDF files.
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)
Constructor, with parameters.
Definition: fs_office2pdf.h:99
foxit::Base
Definition: fs_basictypes.h:451
foxit::addon::conversion::office2pdf::Office2PDF
Definition: fs_office2pdf.h:257
foxit::addon::conversion::office2pdf::Word2PDFConfig::Word2PDFConfig
Word2PDFConfig(bool is_generate_bookmark)
Constructor, with parameters.
Definition: fs_office2pdf.h:49
foxit
Foxit namespace.
Definition: fs_pdf3d.h:26
CFX_ByteString
BYTE STRING CLASS.
Definition: fx_string.h:317
foxit::addon::conversion::office2pdf::Office2PDF::Release
static void Release()
Release all resource allocated by Foxit PDF Conversion.
foxit::addon::conversion::office2pdf::Word2PDFConfig::is_generate_bookmark
bool is_generate_bookmark
A boolean value which indicates whether to export bookmarks to converted PDF file.
Definition: fs_office2pdf.h:81
foxit::addon::conversion::office2pdf::Word2PDFConfig::operator=
Word2PDFConfig & operator=(const Word2PDFConfig &data)
Assign operator.
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)
Convert an Excel format file to a PDF file.
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)
Convert a PowerPoint format file to a PDF file.
foxit::addon::conversion::office2pdf::Office2PDFSettingData::word_setting_data
Word2PDFConfig word_setting_data
A setting data object that used for converting Word format documents to PDF format documents.
Definition: fs_office2pdf.h:236