Class MarkdownToPdfOptions
- Namespace
- LMKit.Document.Conversion
- Assembly
- LM-Kit.NET.dll
Configuration options for Markdown-to-PDF conversion.
public sealed class MarkdownToPdfOptions
- Inheritance
-
MarkdownToPdfOptions
- Inherited Members
Examples
Example: Convert Markdown to PDF with A4 page size and custom margins.
using LMKit.Document.Conversion;
var options = new MarkdownToPdfOptions
{
PageWidth = 595.28f, // A4 width in points
PageHeight = 841.89f, // A4 height in points
MarginTop = 54f, // 0.75 inch
MarginBottom = 54f,
MarginLeft = 54f,
MarginRight = 54f,
BaseFontSize = 10f,
LineSpacing = 1.5f
};
string markdown = "# Report\n\nGenerated with custom page settings.";
MarkdownToPdf.ConvertToFile(markdown, "report_a4.pdf", options);
Remarks
All dimensional values are expressed in PDF points (1 point = 1/72 inch). Default values produce a US Letter page (8.5 x 11 inches) with 1-inch margins.
Properties
- BaseFontSize
Gets or sets the base font size in points. Default is 11.
- LineSpacing
Gets or sets the line spacing multiplier. Default is 1.4.
- MarginBottom
Gets or sets the bottom margin in points. Default is 72 (1 inch).
- MarginLeft
Gets or sets the left margin in points. Default is 72 (1 inch).
- MarginRight
Gets or sets the right margin in points. Default is 72 (1 inch).
- MarginTop
Gets or sets the top margin in points. Default is 72 (1 inch).
- PageHeight
Gets or sets the page height in points. Default is 792 (11 inches).
- PageWidth
Gets or sets the page width in points. Default is 612 (8.5 inches).