Foxit PDF SDK
fs_convert.h
Go to the documentation of this file.
1 
15 #ifndef FS_CONVERT_H_
16 #define FS_CONVERT_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20 #include "pdf/fs_pdfpage.h"
21 
27 namespace foxit {
31 namespace addon {
35 namespace conversion {
37 class HTML2PDFSettingData FS_FINAL : public Object{
38  public:
44  typedef enum _HTML2PDFPageMode {
50 
53  : page_width(0)
54  , page_height(0)
55  , is_to_page_scale(false)
56  , page_margin(0.0f, 0.0f, 0.0f, 0.0f)
57  , rotate_degrees(common::e_Rotation0)
58  , is_convert_link(false)
59  , is_generate_tag(false)
61  {}
62 
82  this->page_width = page_width;
83  this->page_height = page_height;
84  this->is_to_page_scale = is_to_page_scale;
85  this->page_margin = page_margin;
86  this->is_convert_link = is_convert_link;
87  this->rotate_degrees = rotate_degrees;
88  this->is_generate_tag = is_generate_tag;
89  this->page_mode = page_mode;
90  }
91 
100  page_width = data.page_width;
101  page_height = data.page_height;
103  page_margin = data.page_margin;
107  page_mode = data.page_mode;
108  return (*this);
109  }
110 
130  this->page_width = page_width;
131  this->page_height = page_height;
132  this->is_to_page_scale = is_to_page_scale;
133  this->page_margin = page_margin;
134  this->is_convert_link = is_convert_link;
135  this->rotate_degrees = rotate_degrees;
136  this->is_generate_tag = is_generate_tag;
137  this->page_mode = page_mode;
138  }
139 
141  float page_width;
142 
148  float page_height;
149 
152 
160 
166 
169 
172 
178 };
179 
180 #if (defined(_WIN32) || defined(_WIN64))
181 
183 class Word2PDFSettingData FS_FINAL : public Object{
184  public:
191  typedef enum _ConvertOptimizeOption {
197 
204  typedef enum _ConvertContentOption {
210 
216  typedef enum _ConvertBookmarkOption {
231 
232 
235  : include_doc_props(false)
236  , convert_to_pdfa(false)
240  {}
241 
267  this->include_doc_props = include_doc_props;
268  this->convert_to_pdfa = convert_to_pdfa;
269  this->optimize_option = optimize_option;
270  this->content_option = content_option;
271  this->bookmark_option = bookmark_option;
272  }
273 
287  return (*this);
288  }
289 
317  this->include_doc_props = include_doc_props;
318  this->convert_to_pdfa = convert_to_pdfa;
319  this->optimize_option = optimize_option;
320  this->content_option = content_option;
321  this->bookmark_option = bookmark_option;
322  }
323 
332 
341 
349 
357 
365 };
366 
368 class Excel2PDFSettingData FS_FINAL : public Object{
369  public:
375  typedef enum _ConvertQuality {
380  } ConvertQuality;
381 
387  typedef enum _ScaleType {
396  } ScaleType;
397 
398 
401  : include_doc_props(false)
402  , convert_to_pdfa(false)
404  , ignore_print_area(true)
406  {}
407 
427  this->include_doc_props = include_doc_props;
428  this->convert_to_pdfa = convert_to_pdfa;
429  this->quality = quality;
430  this->ignore_print_area = ignore_print_area;
431  this->scale_type = scale_type;
432  }
433 
444  quality = data.quality;
446  scale_type = data.scale_type;
447  return (*this);
448  }
449 
471  this->include_doc_props = include_doc_props;
472  this->convert_to_pdfa = convert_to_pdfa;
473  this->quality = quality;
474  this->ignore_print_area = ignore_print_area;
475  this->scale_type = scale_type;
476  }
477 
486 
495 
502 
511 
518 };
519 #endif // #if (defined(_WIN32) || defined(_WIN64))
520 
529 class Convert FS_FINAL : public Base {
530  public:
547  static void FromHTML(const wchar_t* src_html, const wchar_t* engine_path, const wchar_t* cookies_path, const HTML2PDFSettingData& setting_data, const wchar_t* saved_pdf_path, int32 timeout);
548 
549 #if (defined(_WIN32) || defined(_WIN64))
550 
563  static void FromWord(const wchar_t* src_word_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const Word2PDFSettingData& setting_data);
564 
578  static void FromExcel(const wchar_t* src_excel_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const Excel2PDFSettingData& setting_data);
579 #endif // #if (defined(_WIN32) || defined(_WIN64))
580 
581 };
582 }
583 }
584 }
585 #endif
bool include_doc_props
A boolean value which indicates whether to include Word document properties in the converted PDF docu...
Definition: fs_convert.h:331
ConvertBookmarkOption bookmark_option
Bookmark option for covnerting Word to PDF, which specifies whether to export bookmarks to converted ...
Definition: fs_convert.h:364
static void FromWord(const wchar_t *src_word_file_path, const wchar_t *src_file_password, const wchar_t *saved_pdf_path, const Word2PDFSettingData &setting_data)
Convert a Word format file to a PDF file.
bool convert_to_pdfa
(Reserved) A boolean value which indicates whether to convert to a PDF/A file or a common PDF file....
Definition: fs_convert.h:340
bool is_convert_link
Used to decide whether the web link should be coverted or not.
Definition: fs_convert.h:168
ConvertOptimizeOption
Enumeration for optimize option (which specifies resolution and quality) for converting Word to PDF.
Definition: fs_convert.h:191
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
bool is_to_page_scale
Used to decide whether to scale the coverted PDF page or not.
Definition: fs_convert.h:151
Header file for PDF document related definitions and classes.
float page_height
The page height used for the coverted PDF document.
Definition: fs_convert.h:148
bool ignore_print_area
A boolean value which indicates whether to ignore any print area set when convering Excel document to...
Definition: fs_convert.h:510
ConvertOptimizeOption optimize_option
Optimize option for covnerting Word to PDF, which specifies the resolution and quality of the convert...
Definition: fs_convert.h:348
bool convert_to_pdfa
(Reserved) A boolean value which indicates whether to convert to a PDF/A file or a common PDF file....
Definition: fs_convert.h:494
ScaleType scale_type
Scale type for the Excel sheet when converting Excel document to PDF file. Please refer to values sta...
Definition: fs_convert.h:517
bool is_generate_tag
Used to decide whether the tag should be generated or not.
Definition: fs_convert.h:171
Optimize option: convert for screen, which is a lower quality and results in a smaller file size.
Definition: fs_convert.h:195
float page_width
The page width used for the coverted PDF document.
Definition: fs_convert.h:141
HTML2PDFSettingData()
Constructor.
Definition: fs_convert.h:52
Multiple page mode.
Definition: fs_convert.h:48
common::Rotation rotate_degrees
The rotation degree used for the coverted PDF page.Please refer to values starting from common::e_Rot...
Definition: fs_convert.h:165
static void FromHTML(const wchar_t *src_html, const wchar_t *engine_path, const wchar_t *cookies_path, const HTML2PDFSettingData &setting_data, const wchar_t *saved_pdf_path, int32 timeout)
Convert a HTML format file or a url of a Web page to a PDF file.
void Set(bool include_doc_props, bool convert_to_pdfa, ConvertQuality quality, bool ignore_print_area, ScaleType scale_type)
Constructor, with parameters.
Definition: fs_convert.h:469
Excel2PDFSettingData()
Constructor.
Definition: fs_convert.h:400
Fit all rows of one sheet on one page.
Definition: fs_convert.h:393
ScaleType
Enumeration for scaling type for each sheet in the Excel document for convertin Excel to PDF.
Definition: fs_convert.h:387
HTML2PDFSettingData(float page_width, float page_height, bool is_to_page_scale, RectF page_margin, bool is_convert_link, common::Rotation rotate_degrees, bool is_generate_tag, HTML2PDFPageMode page_mode)
Constructor, with parameters.
Definition: fs_convert.h:80
Excel2PDFSettingData(bool include_doc_props, bool convert_to_pdfa, ConvertQuality quality, bool ignore_print_area, ScaleType scale_type)
Constructor, with parameters.
Definition: fs_convert.h:425
Optimize option: convert for print, which is higher quality and results in a larger file size.
Definition: fs_convert.h:193
ConvertBookmarkOption
Enumeration for bookmark option for for converting Word to PDF.
Definition: fs_convert.h:216
bool include_doc_props
A boolean value which indicates whether to include Excel document properties in the converted PDF doc...
Definition: fs_convert.h:485
RectF page_margin
The page margin used for coverted PDF document.
Definition: fs_convert.h:159
HTML2PDFPageMode
Enumeration for page mode used for converting HTML to PDF.
Definition: fs_convert.h:44
Fit a sheet on one page.
Definition: fs_convert.h:395
static void FromExcel(const wchar_t *src_excel_file_path, const wchar_t *src_file_password, const wchar_t *saved_pdf_path, const Excel2PDFSettingData &setting_data)
Convert a Excel format file to a PDF file.
Fit all columns of one sheet on one page.
Definition: fs_convert.h:391
HTML2PDFPageMode page_mode
The page mode used for the converting. Please refer to values starting from HTML2PDFSettingData::e_Pa...
Definition: fs_convert.h:177
Do not create bookmark in converted PDF file.
Definition: fs_convert.h:218
Convert Word document without markup.
Definition: fs_convert.h:206
Word2PDFSettingData & operator=(const Word2PDFSettingData &data)
Assign operator.
Definition: fs_convert.h:281
Header file for common definitions and classes.
Create bookmarks in converted PDF file by using each heading of Word document.
Definition: fs_convert.h:224
void Set(bool include_doc_props, bool convert_to_pdfa, ConvertOptimizeOption optimize_option, ConvertContentOption content_option, ConvertBookmarkOption bookmark_option)
Constructor, with parameters.
Definition: fs_convert.h:315
HTML2PDFSettingData & operator=(const HTML2PDFSettingData &data)
Assign operator.
Definition: fs_convert.h:99
FX_INT32 int32
32-bit signed integer.
Definition: fs_basictypes.h:196
Definition: fs_basictypes.h:399
Word2PDFSettingData()
Constructor.
Definition: fs_convert.h:234
Header file for PDF page related definitions and classes.
ConvertContentOption content_option
Content option for covnerting Word to PDF, which specifies how much content of Word document is to be...
Definition: fs_convert.h:356
ConvertQuality quality
Quality for covnerting Excel to PDF. Please refer to values starting from Excel2PDFSettingData::e_Con...
Definition: fs_convert.h:501
Convert Word document with markup.
Definition: fs_convert.h:208
No rotation.
Definition: fs_common.h:346
Rotation
Enumeration for rotation.
Definition: fs_common.h:344
Foxit namespace.
Definition: fs_compare.h:27
Definition: fs_convert.h:529
Create bookmarks in converted PDF file by using each bookmarks of Word document.
Definition: fs_convert.h:229
void Set(float page_width, float page_height, bool is_to_page_scale, RectF page_margin, bool is_convert_link, common::Rotation rotate_degrees, bool is_generate_tag, HTML2PDFPageMode page_mode)
Set value.
Definition: fs_convert.h:128
Word2PDFSettingData(bool include_doc_props, bool convert_to_pdfa, ConvertOptimizeOption optimize_option, ConvertContentOption content_option, ConvertBookmarkOption bookmark_option)
Constructor, with parameters.
Definition: fs_convert.h:265
ConvertQuality
Enumeration for quality for converting Excel to PDF.
Definition: fs_convert.h:375
ConvertContentOption
Enumeration for content option which specifies how much content of Word document is to be converted t...
Definition: fs_convert.h:204
Excel2PDFSettingData & operator=(const Excel2PDFSettingData &data)
Assign operator.
Definition: fs_convert.h:441
Definition: fx_coordinates.h:771