Foxit PDF Conversion SDK
fs_md2pdf.h
Go to the documentation of this file.
1 
18 #ifndef FS_MD2PDF_H_
19 #define FS_MD2PDF_H_
20 
21 #include "common/fs_common.h"
22 
28 namespace foxit {
29  using namespace common;
30 
31 namespace conversion {
35 namespace md2pdf {
37 class Md2PDFSettingData FS_FINAL : public Object {
38  public:
41  : page_width(612.0f)
42  , page_height(792.0f)
43  , margin_top(72.0f)
44  , margin_bottom(72.0f)
45  , margin_left(72.0f)
46  , margin_right(72.0f)
47  , base_font_size(10.0f)
48  , is_embed_font(false)
49  , style_config_path(L"") {}
50 
73  Md2PDFSettingData(float page_width, float page_height,
74  float margin_top, float margin_bottom,
75  float margin_left, float margin_right,
76  float base_font_size,
77  const wchar_t* custom_font_path, const wchar_t* style_config_path,
78  bool is_embed_font) {
79  this->page_width = page_width;
80  this->page_height = page_height;
81  this->margin_top = margin_top;
82  this->margin_bottom = margin_bottom;
83  this->margin_left = margin_left;
84  this->margin_right = margin_right;
85  this->base_font_size = base_font_size;
86  this->custom_font_path = custom_font_path;
87  this->style_config_path = style_config_path;
88  this->is_embed_font = is_embed_font;
89  }
90 
98  Md2PDFSettingData& operator = (const Md2PDFSettingData& data) {
99  page_width = data.page_width;
100  page_height = data.page_height;
101  margin_top = data.margin_top;
102  margin_bottom = data.margin_bottom;
103  margin_left = data.margin_left;
104  margin_right = data.margin_right;
105  base_font_size = data.base_font_size;
106  custom_font_path = data.custom_font_path;
107  style_config_path = data.style_config_path;
108  is_embed_font = data.is_embed_font;
109  return (*this);
110  }
111 
136  void Set(float page_width, float page_height,
137  float margin_top, float margin_bottom,
138  float margin_left, float margin_right,
139  float base_font_size,
140  const wchar_t* custom_font_path,
141  const wchar_t* style_config_path,
142  bool is_embed_font) {
143  this->page_width = page_width;
144  this->page_height = page_height;
145  this->margin_top = margin_top;
146  this->margin_bottom = margin_bottom;
147  this->margin_left = margin_left;
148  this->margin_right = margin_right;
149  this->base_font_size = base_font_size;
150  this->custom_font_path = custom_font_path;
151  this->style_config_path = style_config_path;
152  this->is_embed_font = is_embed_font;
153  }
154 
156  float page_width;
157 
159  float page_height;
160 
166  float margin_top;
167 
174 
180  float margin_left;
181 
188 
195 
203 
252 
257 };
258 
262 class Md2PDF FS_FINAL : public Base {
263  public:
274  static bool ConvertFromMarkdown(const wchar_t* src_markdown_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const Md2PDFSettingData& setting_data);
275 };
276 
277 } // namespace md2pdf
278 } // namespace conversion
279 } // namespace foxit
280 
281 #endif // FS_MD2PDF_H_
float page_height
Page height in points. The value must be greater than 0. Default value: 792.
Definition: fs_md2pdf.h:159
float margin_left
Left margin in points. Default value: 72. The value must be greater than or equal to 0....
Definition: fs_md2pdf.h:180
WString style_config_path
Path to a JSON style configuration file.
Definition: fs_md2pdf.h:251
CFX_Object Object
Object type.
Definition: fs_basictypes.h:145
WString custom_font_path
Path to a TrueType font file for CJK or custom font support.
Definition: fs_md2pdf.h:202
WIDE STRING CLASS.
Definition: fx_string.h:1452
float margin_bottom
Bottom margin in points. Default value: 72. The value must be greater than or equal to 0....
Definition: fs_md2pdf.h:173
Md2PDFSettingData(float page_width, float page_height, float margin_top, float margin_bottom, float margin_left, float margin_right, float base_font_size, const wchar_t *custom_font_path, const wchar_t *style_config_path, bool is_embed_font)
Constructor, with parameters.
Definition: fs_md2pdf.h:73
float margin_top
Top margin in points. The value must be greater than or equal to 0. The sum of top and bottom margins...
Definition: fs_md2pdf.h:166
Definition: fs_md2pdf.h:262
void Set(float page_width, float page_height, float margin_top, float margin_bottom, float margin_left, float margin_right, float base_font_size, const wchar_t *custom_font_path, const wchar_t *style_config_path, bool is_embed_font)
Set value.
Definition: fs_md2pdf.h:136
Header file for common definitions and classes.
Definition: fs_basictypes.h:238
float margin_right
Right margin in points. Default value: 72. The value must be greater than or equal to 0....
Definition: fs_md2pdf.h:187
float base_font_size
Base font size in points for body text. Default value: 10.
Definition: fs_md2pdf.h:194
bool is_embed_font
Whether to embed font data in the output PDF. Default value: false.
Definition: fs_md2pdf.h:256
float page_width
Page width in points. The value must be greater than 0. Default value: 612.
Definition: fs_md2pdf.h:156
Foxit namespace.
Definition: fs_basictypes.h:124
Md2PDFSettingData()
Constructor.
Definition: fs_md2pdf.h:40