Foxit PDF Conversion SDK
com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData Class Reference

Public Member Functions

 Md2PDFSettingData ()
 Constructor.
 
 Md2PDFSettingData (float page_width, float page_height, float margin_top, float margin_bottom, float margin_left, float margin_right, float base_font_size, String custom_font_path, String style_config_path, boolean is_embed_font)
 Constructor, with parameters. More...
 
synchronized void delete ()
 Clean up related C++ resources immediately. More...
 
float getBase_font_size ()
 Get base font size in points for body text. More...
 
String getCustom_font_path ()
 Get path to a TrueType font file for CJK or custom font support. More...
 
boolean getIs_embed_font ()
 Get whether to embed font data in the output PDF. More...
 
float getMargin_bottom ()
 Get bottom margin in points. More...
 
float getMargin_left ()
 Get left margin in points. More...
 
float getMargin_right ()
 Get right margin in points. More...
 
float getMargin_top ()
 Get top margin in points. More...
 
float getPage_height ()
 Get page height in points. More...
 
float getPage_width ()
 Get page width in points. More...
 
String getStyle_config_path ()
 Get path to a JSON style configuration file. More...
 
void set (float page_width, float page_height, float margin_top, float margin_bottom, float margin_left, float margin_right, float base_font_size, String custom_font_path, String style_config_path, boolean is_embed_font)
 Set value. More...
 
void setBase_font_size (float value)
 Set base font size in points for body text. More...
 
void setCustom_font_path (String value)
 Set path to a TrueType font file for CJK or custom font support. More...
 
void setIs_embed_font (boolean value)
 Set whether to embed font data in the output PDF. More...
 
void setMargin_bottom (float value)
 Set bottom margin in points. More...
 
void setMargin_left (float value)
 Set left margin in points. More...
 
void setMargin_right (float value)
 Set right margin in points. More...
 
void setMargin_top (float value)
 Set top margin in points. More...
 
void setPage_height (float value)
 Set page height in points. More...
 
void setPage_width (float value)
 Set page width in points. More...
 
void setStyle_config_path (String value)
 Set path to a JSON style configuration file. More...
 

Detailed Description

This class represents setting data used for converting Markdown format files to PDF format files.

Constructor & Destructor Documentation

◆ Md2PDFSettingData()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.Md2PDFSettingData ( float  page_width,
float  page_height,
float  margin_top,
float  margin_bottom,
float  margin_left,
float  margin_right,
float  base_font_size,
String  custom_font_path,
String  style_config_path,
boolean  is_embed_font 
)

Constructor, with parameters.

Parameters
[in]page_widthPage width in points. The value must be greater than 0. Default value: 612.
[in]page_heightPage height in points. The value must be greater than 0. Default value: 792.
[in]margin_topTop margin in points. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.\ Default value: 72.
[in]margin_bottomBottom margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.
[in]margin_leftLeft margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.
[in]margin_rightRight margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.
[in]base_font_sizeBase font size in points for body text. Default value: 10.
[in]custom_font_pathPath to a TrueType font file for CJK or custom font support. Empty string means use standard PDF fonts.
[in]style_config_pathPath to a JSON style configuration file.
[in]is_embed_fontWhether to embed font data in the output PDF. Default value: false.

Member Function Documentation

◆ delete()

synchronized void com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.delete ( )

Clean up related C++ resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

◆ getBase_font_size()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getBase_font_size ( )

Get base font size in points for body text.

Heading sizes are calculated as multiples of this value.

Returns
Base font size in points for body text. Default value: 10.

◆ getCustom_font_path()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getCustom_font_path ( )

Get path to a TrueType font file for CJK or custom font support.

When not empty, the specified font will be used for text rendering. Default value: empty string.

Returns
Path to a TrueType font file for CJK or custom font support.

◆ getIs_embed_font()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getIs_embed_font ( )

Get whether to embed font data in the output PDF.

Returns
Whether to embed font data in the output PDF. Default value: false.

◆ getMargin_bottom()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getMargin_bottom ( )

Get bottom margin in points.

Returns
Bottom margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.

◆ getMargin_left()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getMargin_left ( )

Get left margin in points.

Returns
Left margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.

◆ getMargin_right()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getMargin_right ( )

Get right margin in points.

Returns
Right margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.

◆ getMargin_top()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getMargin_top ( )

Get top margin in points.

Returns
Top margin in points. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.\ Default value:

◆ getPage_height()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getPage_height ( )

Get page height in points.

Returns
Page height in points. The value must be greater than 0. Default value: 792.

◆ getPage_width()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getPage_width ( )

Get page width in points.

Returns
Page width in points. The value must be greater than 0. Default value: 612.

◆ getStyle_config_path()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.getStyle_config_path ( )

Get path to a JSON style configuration file.

When not empty, per-element font/size/color/bold/italic/line_spacing settings are loaded from the specified JSON file. Default value: empty string (built-in defaults apply).

Supported JSON keys per element object (h1-h6, paragraph, code_block, block_quote, list_item, table_cell):

  • "font_size" : float, point size (e.g. 14.0)

  • "bold" : bool

  • "italic" : bool

  • "color_r/g/b" : float 0.0-1.0, RGB components

  • "line_spacing" : float 0.5-5.0, line-height multiplier

  • "space_before" : float 0.0-10.0, spacing before the block as a multiple of font_size. Only effective for heading elements (h1-h6); ignored for other element types.

  • "space_after" : float 0.0-10.0, spacing after the block as a multiple of font_size.

Example JSON file content:

Returns
Path to a JSON style configuration file.

◆ set()

void com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.set ( float  page_width,
float  page_height,
float  margin_top,
float  margin_bottom,
float  margin_left,
float  margin_right,
float  base_font_size,
String  custom_font_path,
String  style_config_path,
boolean  is_embed_font 
)

Set value.

Parameters
[in]page_widthPage width in points. The value must be greater than 0. Default value: 612.
[in]page_heightPage height in points. The value must be greater than 0. Default value: 792.
[in]margin_topTop margin in points. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.\ Default value: 72.
[in]margin_bottomBottom margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.
[in]margin_leftLeft margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.
[in]margin_rightRight margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.
[in]base_font_sizeBase font size in points for body text.
[in]custom_font_pathPath to a TrueType font file for CJK or custom font support.
[in]style_config_pathPath to a JSON style configuration file.
[in]is_embed_fontWhether to embed font data in the output PDF.
Returns
None.

◆ setBase_font_size()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setBase_font_size ( float  value)

Set base font size in points for body text.

Heading sizes are calculated as multiples of this value.

Parameters
[in]valueBase font size in points for body text. Default value: 10.
Returns
None.

◆ setCustom_font_path()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setCustom_font_path ( String  value)

Set path to a TrueType font file for CJK or custom font support.

When not empty, the specified font will be used for text rendering. Default value: empty string.

Parameters
[in]valuePath to a TrueType font file for CJK or custom font support.
Returns
None.

◆ setIs_embed_font()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setIs_embed_font ( boolean  value)

Set whether to embed font data in the output PDF.

Parameters
[in]valueWhether to embed font data in the output PDF. Default value: false.
Returns
None.

◆ setMargin_bottom()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setMargin_bottom ( float  value)

Set bottom margin in points.

Parameters
[in]valueBottom margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.
Returns
None.

◆ setMargin_left()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setMargin_left ( float  value)

Set left margin in points.

Parameters
[in]valueLeft margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.
Returns
None.

◆ setMargin_right()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setMargin_right ( float  value)

Set right margin in points.

Parameters
[in]valueRight margin in points. Default value: 72. The value must be greater than or equal to 0. The sum of left and right margins must be less than page width.
Returns
None.

◆ setMargin_top()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setMargin_top ( float  value)

Set top margin in points.

Parameters
[in]valueTop margin in points. The value must be greater than or equal to 0. The sum of top and bottom margins must be less than page height.\ Default value:
Returns
None.

◆ setPage_height()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setPage_height ( float  value)

Set page height in points.

Parameters
[in]valuePage height in points. The value must be greater than 0. Default value: 792.
Returns
None.

◆ setPage_width()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setPage_width ( float  value)

Set page width in points.

Parameters
[in]valuePage width in points. The value must be greater than 0. Default value: 612.
Returns
None.

◆ setStyle_config_path()

com.foxit.sdk.conversion.md2pdf.Md2PDFSettingData.setStyle_config_path ( String  value)

Set path to a JSON style configuration file.

When not empty, per-element font/size/color/bold/italic/line_spacing settings are loaded from the specified JSON file. Default value: empty string (built-in defaults apply).

Supported JSON keys per element object (h1-h6, paragraph, code_block, block_quote, list_item, table_cell):

  • "font_size" : float, point size (e.g. 14.0)

  • "bold" : bool

  • "italic" : bool

  • "color_r/g/b" : float 0.0-1.0, RGB components

  • "line_spacing" : float 0.5-5.0, line-height multiplier

  • "space_before" : float 0.0-10.0, spacing before the block as a multiple of font_size. Only effective for heading elements (h1-h6); ignored for other element types.

  • "space_after" : float 0.0-10.0, spacing after the block as a multiple of font_size.

Example JSON file content:

Parameters
[in]valuePath to a JSON style configuration file.
Returns
None.