-
Notifications
You must be signed in to change notification settings - Fork 5
Markdown2Pdf.Options.SerializableOptions
Namespace: Markdown2Pdf.Options
Assembly: Markdown2Pdf.dll
The Markdown2PdfOptions in a serializable format.
public class SerializableOptionsobject.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object, object), object.ToString()
Path to chrome or chromium executable. If set to null downloads chromium by itself. Default: null.
public string? ChromePath { get; set; }The theme to use for highlighting code blocks.
Default: Github.
public string? CodeHighlightTheme { get; set; }A string containing any content valid inside a HTML <head>
to apply extra scripting / styling to the document.
Default: null.
public string? CustomHeadContent { get; set; }Example adding PDF pagebreaks:
options.CustomHeadContent = "h1, h2, h3 { page-break-before: always; }";The title of this document. Can be injected into the header / footer by adding the class document-title to the element.
Default: null.
public string? DocumentTitle { get; set; }Auto detect the language for code blocks without specfied language. Default: false.
public bool? EnableAutoLanguageDetection { get; set; }bool?
An HTML string to use as the document-header. Default: null.
public string? FooterHtml { get; set; }Html-elements with the classes date, title, document-title, url, pageNumber will get their content replaced based on the information.
Note that document-title can be set with the option DocumentTitle.
The paper format for the PDF.
Default: A4.
public string? Format { get; set; }An HTML string to use as the document-header. Default: null.
public string? HeaderHtml { get; set; }Html-elements with the classes date, title, document-title, url, pageNumber will get their content replaced based on the information.
Note that document-title can be set with the option DocumentTitle.
Paper orientation. Default: false.
public bool? IsLandscape { get; set; }bool?
Doesn't delete the HTML-file used for generating the PDF if set to true. Default: false.
public bool? KeepHtml { get; set; }bool?
Css-margins for the sides of the document. Default: null.
public MarginOptions? MarginOptions { get; set; }The title in the metadata (PDF properties). Default: null.
public string? MetadataTitle { get; set; }If not set, first DocumentTitle and then the Output-Filename are used as fallback values.
Options that decide from where to load additional modules.
Default: Remote.
public string? ModuleOptions { get; set; }Scale of the webpage rendering. Defaults to 1. Scale amount must be between 0.1 and 2.
public decimal? Scale { get; set; }Options to create a Table of Contents for the PDF, generated from all headers.
The TOC will be inserted into all [TOC], [[TOC]] or <!-- toc --> comments within the markdown document.
Example Markdown document with a TOC:
# My Document
[TOC]
...options.TableOfContents = new TableOfContentsOptions {
ListStyle = ListStyle.Decimal,
// Include all heading levels from 2 to 4.
MinDepthLevel = 2,
MaxDepthLevel = 4
};<!-- omit from toc -->:
## This header won't be displayed in the TOC <!-- omit from toc -->public TableOfContentsOptions? TableOfContents { get; set; }The TOC gets generated within a <nav class="table-of-contents">. This can be used to apply extra custom styles.
The styling to apply to the document. Default: Github.
public string? Theme { get; set; }Converts this serializable options into proper Markdown2PdfOptions.
public Markdown2PdfOptions ToMarkdown2PdfOptions()The deserialized Markdown2PdfOptions.