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)
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
CFX_Object Object
Object type.
Definition: fs_basictypes.h:145
Definition: fs_basictypes.h:152
CFX_WideString WString
Wide string.
Definition: fs_basictypes.h:147
Header file for common definitions and classes.
Foxit namespace.
Definition: fs_basictypes.h:124