Foxit PDF Conversion SDK
fs_md2pdf.h
浏览该文件的文档.
1 
17 #ifndef FS_MD2PDF_H_
18 #define FS_MD2PDF_H_
19 
20 #include "common/fs_common.h"
21 
27 namespace foxit {
28  using namespace common;
29 
30 namespace conversion {
34 namespace md2pdf {
36 class Md2PDFSettingData FS_FINAL : public Object {
37  public:
40  : page_width(612.0f)
41  , page_height(792.0f)
42  , margin_top(72.0f)
43  , margin_bottom(72.0f)
44  , margin_left(72.0f)
45  , margin_right(72.0f)
46  , base_font_size(10.0f)
47  , is_embed_font(false)
48  , style_config_path(L"") {}
49 
64  Md2PDFSettingData(float page_width, float page_height,
65  float margin_top, float margin_bottom,
66  float margin_left, float margin_right,
67  float base_font_size,
68  const wchar_t* custom_font_path, const wchar_t* style_config_path,
69  bool is_embed_font) {
70  this->page_width = page_width;
71  this->page_height = page_height;
72  this->margin_top = margin_top;
73  this->margin_bottom = margin_bottom;
74  this->margin_left = margin_left;
75  this->margin_right = margin_right;
76  this->base_font_size = base_font_size;
77  this->custom_font_path = custom_font_path;
78  this->style_config_path = style_config_path;
79  this->is_embed_font = is_embed_font;
80  }
81 
89  Md2PDFSettingData& operator = (const Md2PDFSettingData& data) {
90  page_width = data.page_width;
91  page_height = data.page_height;
92  margin_top = data.margin_top;
93  margin_bottom = data.margin_bottom;
94  margin_left = data.margin_left;
95  margin_right = data.margin_right;
96  base_font_size = data.base_font_size;
97  custom_font_path = data.custom_font_path;
98  style_config_path = data.style_config_path;
99  is_embed_font = data.is_embed_font;
100  return (*this);
101  }
102 
119  void Set(float page_width, float page_height,
120  float margin_top, float margin_bottom,
121  float margin_left, float margin_right,
122  float base_font_size,
123  const wchar_t* custom_font_path,
124  const wchar_t* style_config_path,
125  bool is_embed_font) {
126  this->page_width = page_width;
127  this->page_height = page_height;
128  this->margin_top = margin_top;
129  this->margin_bottom = margin_bottom;
130  this->margin_left = margin_left;
131  this->margin_right = margin_right;
132  this->base_font_size = base_font_size;
133  this->custom_font_path = custom_font_path;
134  this->style_config_path = style_config_path;
135  this->is_embed_font = is_embed_font;
136  }
137 
139  float page_width;
140 
142  float page_height;
143 
145  float margin_top;
146 
149 
151  float margin_left;
152 
155 
162 
170 
219 
224 };
225 
229 class Md2PDF FS_FINAL : public Base {
230  public:
241  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);
242 };
243 
244 } // namespace md2pdf
245 } // namespace conversion
246 } // namespace foxit
247 
248 #endif // FS_MD2PDF_H_
float page_height
页面高度,单位:点。默认值:792。必须大于 0。
Definition: fs_md2pdf.h:142
float margin_left
左边距,单位:点。默认值:72。必须大于或等于 0,且左、右边距之和必须小于页面宽度。
Definition: fs_md2pdf.h:151
WString style_config_path
JSON 样式配置文件路径。
Definition: fs_md2pdf.h:218
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:145
WString custom_font_path
TrueType 字体文件路径,用于 CJK 或自定义字体支持。
Definition: fs_md2pdf.h:169
宽字符串类
Definition: fx_string.h:1457
float margin_bottom
下边距,单位:点。默认值:72。必须大于或等于 0,且上、下边距之和必须小于页面高度。
Definition: fs_md2pdf.h:148
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)
带参数的构造函数。
Definition: fs_md2pdf.h:64
float margin_top
上边距,单位:点。默认值:72。必须大于或等于 0,且上、下边距之和必须小于页面高度。
Definition: fs_md2pdf.h:145
Definition: fs_md2pdf.h:229
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)
设置值。
Definition: fs_md2pdf.h:119
通用定义和类的头文件。
Definition: fs_basictypes.h:238
float margin_right
右边距,单位:点。默认值:72。必须大于或等于 0,且左、右边距之和必须小于页面宽度。
Definition: fs_md2pdf.h:154
float base_font_size
正文基础字号,单位:点。默认值:10。
Definition: fs_md2pdf.h:161
bool is_embed_font
是否将字体数据嵌入输出 PDF。默认值:false。
Definition: fs_md2pdf.h:223
float page_width
页面宽度,单位:点。默认值:612。必须大于 0。
Definition: fs_md2pdf.h:139
Foxit 命名空间。
Definition: fs_basictypes.h:124
Md2PDFSettingData()
构造函数。
Definition: fs_md2pdf.h:39