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)
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();
296  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);
297 
315  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);
316 
330  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);
331 
348  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);
349 
363  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);
364 
381  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);
382 };
383 } // namespace office2pdf
384 } // namespace conversion
385 } // namespace addon
386 } // namespace foxit
387 
388 #endif //defined(_WIN32) || defined(_WIN64)
389 #endif
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:221
fs_common.h
Header file for common definitions and classes.
foxit::WString
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:223
foxit
Foxit namespace.
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