VectSharp 2.6.1
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.Markdown.MarkdownRenderer Class Reference

Renders Markdown documents into VectSharp graphics objects. More...

Public Types

enum  VerticalAlignment
 Defines the options for the vertical alignment of table cells. More...
 

Public Member Functions

 MarkdownRenderer ()
 Create a new MarkdownRenderer; More...
 
Page RenderSinglePage (string markdownSource, double width, out Dictionary< string, string > linkDestinations, out List<(int level, string heading, string tag)> headingTree)
 Parses the supplied markdownSource using all the supported extensions and renders the resulting document. Page breaks are disabled, and the document is rendered as a single page with the specified width . The page will be cropped at the appropriate height to contain the entire document. More...
 
Page RenderSinglePage (MarkdownDocument markdownDocument, double width, out Dictionary< string, string > linkDestinations, out List<(int level, string heading, string tag)> headingTree)
 Renders the supplied markdownDocument . Page breaks are disabled, and the document is rendered as a single page with the specified width . The page will be cropped at the appropriate height to contain the entire document. More...
 
Document Render (string markdownSource, out Dictionary< string, string > linkDestinations, out List<(int level, string heading, string tag)> headingTree)
 Parses the supplied markdownSource using all the supported extensions and renders the resulting document. The Document produced consists of one or more pages of the size specified in the PageSize of the current instance. More...
 
Document Render (MarkdownDocument mardownDocument, out Dictionary< string, string > linkDestinations, out List<(int level, string heading, string tag)> headingTree)
 Renders the supplied mardownDocument . The Document produced consists of one or more pages of the size specified in the PageSize of the current instance. More...
 

Properties

double BaseFontSize = 9.71424 [get, set]
 The base font size to use when rendering the document. This will be the size of regular elements, and the size of header elements will be expressed as a multiple of this. More...
 
double MathFontScalingFactor = 0.85 [get, set]
 Scaling factor for the font size to use when rendering math. More...
 
double[] HeaderFontSizeMultipliers [get]
 The font size for elements at each header level. The values in this array will be multiplied by the BaseFontSize. More...
 
double[] HeaderLineThicknesses = new double[] { 1, 1, 0, 0, 0, 0 } [get]
 The thickness of the separator line after a header of each level. A value of 0 disables the line after headers of that level. More...
 
double ThematicBreakThickness = 2 [get, set]
 The thickness of thematic break lines. More...
 
FontFamily RegularFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.Helvetica) [get, set]
 The font family for regular text. More...
 
FontFamily BoldFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.HelveticaBold) [get, set]
 The font family for bold text. More...
 
FontFamily ItalicFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.HelveticaOblique) [get, set]
 The font family for italic text. More...
 
FontFamily BoldItalicFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.HelveticaBoldOblique) [get, set]
 The font family for bold italic text. More...
 
FontFamily CodeFont = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.Courier) [get, set]
 The font family for code elements. More...
 
FontFamily CodeFontBold = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.CourierBold) [get, set]
 The font family for bold code elements. More...
 
FontFamily CodeFontItalic = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.CourierOblique) [get, set]
 The font family for italic code elements. More...
 
FontFamily CodeFontBoldItalic = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.CourierBoldOblique) [get, set]
 The font family for bold italic code elements. More...
 
double UnderlineThickness = 0.075 [get, set]
 The thickness of underlines. This value will be multiplied by the font size of the element being underlined. More...
 
double BoldUnderlineThickness = 0.15 [get, set]
 The thickness of underlines for bold text. This value will be multiplied by the font size of the element being underlined. More...
 
Margins Margins = new Margins(55, 55, 55, 55) [get, set]
 The margins of the page. More...
 
Margins TableCellMargins = new Margins(5, 0, 5, 0) [get, set]
 The margins for table cells. More...
 
VerticalAlignment TableVAlign = VerticalAlignment.Middle [get, set]
 The vertical alignment of table cells. More...
 
Size PageSize = new Size(595, 842) [get, set]
 The size of the page. More...
 
double SpaceBeforeParagaph = 0 [get, set]
 The space before each text paragraph. This value will be multiplied by the BaseFontSize. More...
 
double SpaceAfterParagraph = 0.75 [get, set]
 The space after each text paragraph. This value will be multiplied by the BaseFontSize. More...
 
double SpaceAfterLine = 0.25 [get, set]
 The space after each line of text. This value will be multiplied by the BaseFontSize. More...
 
double SpaceBeforeHeading = 0.25 [get, set]
 The space before each heading. This value will be multiplied by the font size of the heading. More...
 
double SpaceAfterHeading = 0.25 [get, set]
 The space after each heading. This value will be multiplied by the font size of the heading. More...
 
double CodeInlineMargin = 0.25 [get, set]
 The margin at the left and right of code inlines. This value will be multiplied by the current font size. More...
 
double IndentWidth = 40 [get, set]
 The indentation width used for list items. More...
 
double QuoteBlockIndentWidth = 30 [get, set]
 The indentation width used for block quotes. More...
 
double QuoteBlockBarWidth = 5 [get, set]
 The thickness of the bar to the left of block quotes. More...
 
double SubSuperscriptFontSize = 0.7 [get, set]
 The font size for subscripts and superscripts. This value will be multiplied by the current font size. More...
 
double SuperscriptShift = 0.33 [get, set]
 The upwards shift in the baseline for superscript elements. This value will be multiplied by the current font size. More...
 
double SubscriptShift = 0.14 [get, set]
 The downwards shift in the baseline for subscript elements. This value will be multiplied by the current font size. More...
 
string BaseImageUri = "" [get, set]
 The base uri for resolving relative image addresses. More...
 
Func< string, string,(string, bool)> ImageUriResolver = HTTPUtils.ResolveImageURI [get, set]
 A method used to resolve (possibly remote) image uris into local file paths. The first argument of the method should be the image uri and the second argument the base uri used to resolve relative links. The method should return a tuple containing the path of the local file and a boolean value indicating whether the file has been fetched from a remote location and should be deleted after the program has finished using it. More...
 
Func< string,(string, bool)> EmojiUriResolver [get, set]
 A method used to resolve emojis. The argument of the method should be an emoji uri of the form "emoji://{name}_heading:{level}", where "{name}" is the name of the emoji and "{level}" is the heading level, or "unicode://{unicode}_heading:{level}", where "{unicode}" is a unicode surrogate pair. The method should return a tuple containing the path of a local file containing the rendered emoji and a boolean value indicating whether the file should be deleted after the program has finished using it. More...
 
Uri BaseLinkUri = new Uri("about:blank") [get, set]
 The base uri for resolving links. More...
 
Func< string, string > LinkUriResolver = a => a [get, set]
 A method used to resolve link addresses. The argument of the method should be the absolute link, and the method should return the resolved address. This can be used to "redirect" links to a different target. More...
 
Func< string, RasterImageRasterImageLoader = null [get, set]
 A method used to a load raster image from a local file. The argument of the method should be the path of a local image file, and the method should return a RasterImage representing that file. For example, this can be achieved using the RasterImageFile class from the VectSharp.MuPDFUtils package. If this is null, only SVG images will be included in the document. More...
 
double ImageUnitMultiplier = 0.60714 [get, set]
 The size of images (as defined in the image's width and height attributes) will be multiplied by this value to determine the actual size of the image on the page. This has no effect on images without a width or height attribute. More...
 
double ImageMultiplier = 1 [get, set]
 The size of images will be multiplied by this value to determine the actual size of the image on the page. For images that have a width or height attribute, this will be applied in addition to the ImageUnitMultiplier. For images without width and height, only this multiplier will be applied. More...
 
double ImageSideMargin = 10 [get, set]
 The margin on the right of left-aligned images and on the left of right-aligned images. More...
 
double ImageMarginTolerance = 25 [get, set]
 Images will be allowed to extend into the page bottom margin area by this amount before triggering a page break. This should be smaller than the bottom margin, otherwise images risk being cut off by the page boundary. More...
 
Func< string, string, List< List< FormattedString > > > SyntaxHighlighter = VectSharp.Markdown.SyntaxHighlighter.GetSyntaxHighlightedLines [get, set]
 A method used for syntax highlighting. The first argument should be the source code to highlight, while the second parameter is the name of the language to use for the highlight. The method should return a list of lists of FormattedStrings, with each list of FormattedStrings representing a line. For each code block, if the method returns null, no syntax highlighting is used. More...
 
List< Action< Graphics, Colour > > Bullets [get]
 Bullet points used for unordered lists. Each element of this list corresponds to the bullet for each level of list indentation. If the list indentation is greater than the number of elements in this list, the bullet points will be reused cyclically. Each element of this list is a method taking two arguments: the first is the Graphics object on which the bullet point should be drawn, while the second is the colour in which it should be painted. The method should draw the bullet point centered around the origin. The size of the bullet point will be multiplied by the current font size. More...
 
Graphics TaskListUncheckedBullet [get, set]
 The bullet used for unchecked task list items. More...
 
Graphics TaskListCheckedBullet [get, set]
 The bullet used for checked task list items. More...
 
Colour ForegroundColour = Colours.Black [get, set]
 The foreground colour for text elements. More...
 
Colour BackgroundColour = Colours.White [get, set]
 The background colour for the page. More...
 
Colour HeaderLineColour = Colour.FromRgb(180, 180, 180) [get, set]
 The colour of the line below headers. More...
 
Colour ThematicBreakLineColour = Colour.FromRgb(180, 180, 200) [get, set]
 The colour for thematic break lines. More...
 
Colour LinkColour = Colour.FromRgb(25, 140, 191) [get, set]
 The colour for hypertext links. More...
 
Colour CodeInlineBackgroundColour = Colour.FromRgb(240, 240, 240) [get, set]
 The background colour for code inlines. More...
 
Colour CodeBlockBackgroundColour = Colour.FromRgb(240, 240, 245) [get, set]
 The background colour for code blocks. More...
 
Colour QuoteBlockBarColour = Colour.FromRgb(75, 152, 220) [get, set]
 The colour for the bar to the left of block quotes. More...
 
Colour QuoteBlockBackgroundColour = Colour.FromRgb(240, 240, 255) [get, set]
 The background colour for block quotes. More...
 
Colour InsertedColour = Colour.FromRgb(0, 158, 115) [get, set]
 The colour for text that has been styled as "inserted". More...
 
Colour MarkedColour = Colour.FromRgb(213, 94, 0) [get, set]
 The colour for text that has been styled as "marked". More...
 
Colour TableHeaderRowSeparatorColour = Colours.Black [get, set]
 The colour for the line separating the table header row from normal rows. More...
 
Colour TableRowSeparatorColour = Colour.FromRgb(180, 180, 180) [get, set]
 The colour for lines separating table rows from each other. More...
 
double TableHeaderRowSeparatorThickness = 2 [get, set]
 The thickness of the line separating the table header row from normal rows. More...
 
double TableHeaderSeparatorThickness = 1 [get, set]
 The thickness of lines separating table rows from each other. More...
 
bool AllowPageBreak = true [get, set]
 Determines whether page breaks should be treated as such in the source. More...
 
static EmojiMapping EmojiURLMapping = new EmojiMapping(new Dictionary<string, string>(EmojiMapping.GetDefaultEmojiShortcodeToUnicode().Select(x => new KeyValuePair<string, string>(x.Key, "emoji://" + x.Key.Trim(':')))), EmojiMapping.GetDefaultSmileyToEmojiShortcode()) [get]
 Emoji mapping that transforms emojis (e.g. ":something:") into URLs (e.g., "emoji://something"). More...
 
MarkdownPipelineBuilder MarkdownPipelineBuilder = new MarkdownPipelineBuilder().UseGridTables().UsePipeTables().UseEmphasisExtras().UseGenericAttributes().UseAutoIdentifiers().UseAutoLinks().UseTaskLists().UseListExtras().UseCitations().UseMathematics().UseSmartyPants().UseEmojiAndSmiley(EmojiURLMapping).UseUnicodeEmoji() [get, set]
 Markdown pipeline builder used to parse markdown source. More...
 

Events

EventHandler< PageStartedEventArgsPageStarted
 Invoked when a new page is started. More...
 
EventHandler< PageFinishedEventArgsPageFinished
 Invoked when a page is finished, before starting a new page (or at the end of the document). More...
 
EventHandler< BlockRenderingEventArgsBlockRendering
 Invoked just before rendering a Block. More...
 
EventHandler< BlockRenderedEventArgsBlockRendered
 Invoked just after rendering a Block. More...
 
EventHandler< InlineRenderingEventArgsInlineRendering
 Invoked just before rendering an Inline. More...
 
EventHandler< InlineRenderedEventArgsInlineRendered
 Invoked just after rendering an Inline. More...
 
EventHandler< LineMeasuredEventArgsLineMeasured
 Invoked after content in a Line has been measured, but before deciding whether to render the line on the current page or on a new page. More...
 
EventHandler< LineEventArgsLineRendering
 Invoked just before rendering a Line, after a new page has been created if necessary. More...
 
EventHandler< LineEventArgsLineRendered
 Invoked just after rendering a Line. More...
 

Detailed Description

Renders Markdown documents into VectSharp graphics objects.

Definition at line 32 of file MarkdownRenderer.Blocks.cs.

Member Enumeration Documentation

◆ VerticalAlignment

Defines the options for the vertical alignment of table cells.

Definition at line 119 of file MarkdownRenderer.Properties.cs.

Constructor & Destructor Documentation

◆ MarkdownRenderer()

VectSharp.Markdown.MarkdownRenderer.MarkdownRenderer ( )

Create a new MarkdownRenderer;

Definition at line 44 of file MarkdownRenderer.cs.

Member Function Documentation

◆ Render() [1/2]

Document VectSharp.Markdown.MarkdownRenderer.Render ( MarkdownDocument  mardownDocument,
out Dictionary< string, string >  linkDestinations,
out List<(int level, string heading, string tag)>  headingTree 
)

Renders the supplied mardownDocument . The Document produced consists of one or more pages of the size specified in the PageSize of the current instance.

Parameters
mardownDocumentThe markdown document to render.
linkDestinationsWhen this method returns, this object will contain a dictionary used to associate graphic action tags to hyperlinks. This can be used to enable such links when rendering the Document to a file.
headingTreeWhen this method returns, this object will contain a list of the headings contained in the document and the corresponding tag. This can be used to create a document outline.
Returns
A Document containing a rendering of the supplied markdown document, consisting of one or more pages of the size specified in the PageSize of the current instance.

Definition at line 157 of file MarkdownRenderer.cs.

◆ Render() [2/2]

Document VectSharp.Markdown.MarkdownRenderer.Render ( string  markdownSource,
out Dictionary< string, string >  linkDestinations,
out List<(int level, string heading, string tag)>  headingTree 
)

Parses the supplied markdownSource using all the supported extensions and renders the resulting document. The Document produced consists of one or more pages of the size specified in the PageSize of the current instance.

Parameters
markdownSourceThe markdown source to parse.
linkDestinationsWhen this method returns, this value will contain a dictionary used to associate graphic action tags to hyperlinks. This can be used to enable such links when rendering the Document to a file.
headingTreeWhen this method returns, this object will contain a list of the headings contained in the document and the corresponding tag. This can be used to create a document outline.
Returns
A Document containing a rendering of the supplied markdown document, consisting of one or more pages of the size specified in the PageSize of the current instance.

Definition at line 143 of file MarkdownRenderer.cs.

◆ RenderSinglePage() [1/2]

Page VectSharp.Markdown.MarkdownRenderer.RenderSinglePage ( MarkdownDocument  markdownDocument,
double  width,
out Dictionary< string, string >  linkDestinations,
out List<(int level, string heading, string tag)>  headingTree 
)

Renders the supplied markdownDocument . Page breaks are disabled, and the document is rendered as a single page with the specified width . The page will be cropped at the appropriate height to contain the entire document.

Parameters
markdownDocumentThe markdown document to render.
widthThe width of the page.
linkDestinationsWhen this method returns, this value will contain a dictionary used to associate graphic action tags to hyperlinks. This can be used to enable such links when rendering the Page to a file.
headingTreeWhen this method returns, this object will contain a list of the headings contained in the document and the corresponding tag. This can be used to create a document outline.
Returns
A Page containing a rendering of the supplied markdown document.

Definition at line 81 of file MarkdownRenderer.cs.

◆ RenderSinglePage() [2/2]

Page VectSharp.Markdown.MarkdownRenderer.RenderSinglePage ( string  markdownSource,
double  width,
out Dictionary< string, string >  linkDestinations,
out List<(int level, string heading, string tag)>  headingTree 
)

Parses the supplied markdownSource using all the supported extensions and renders the resulting document. Page breaks are disabled, and the document is rendered as a single page with the specified width . The page will be cropped at the appropriate height to contain the entire document.

Parameters
markdownSourceThe markdown source to parse.
widthThe width of the page.
linkDestinationsWhen this method returns, this value will contain a dictionary used to associate graphic action tags to hyperlinks. This can be used to enable such links when rendering the Page to a file.
headingTreeWhen this method returns, this object will contain a list of the headings contained in the document and the corresponding tag. This can be used to create a document outline.
Returns
A Page containing a rendering of the supplied markdown document.

Definition at line 66 of file MarkdownRenderer.cs.

Property Documentation

◆ AllowPageBreak

bool VectSharp.Markdown.MarkdownRenderer.AllowPageBreak = true
getset

Determines whether page breaks should be treated as such in the source.

Definition at line 395 of file MarkdownRenderer.Properties.cs.

◆ BackgroundColour

Colour VectSharp.Markdown.MarkdownRenderer.BackgroundColour = Colours.White
getset

The background colour for the page.

Definition at line 325 of file MarkdownRenderer.Properties.cs.

◆ BaseFontSize

double VectSharp.Markdown.MarkdownRenderer.BaseFontSize = 9.71424
getset

The base font size to use when rendering the document. This will be the size of regular elements, and the size of header elements will be expressed as a multiple of this.

Definition at line 31 of file MarkdownRenderer.Properties.cs.

◆ BaseImageUri

string VectSharp.Markdown.MarkdownRenderer.BaseImageUri = ""
getset

The base uri for resolving relative image addresses.

Definition at line 210 of file MarkdownRenderer.Properties.cs.

◆ BaseLinkUri

Uri VectSharp.Markdown.MarkdownRenderer.BaseLinkUri = new Uri("about:blank")
getset

The base uri for resolving links.

Definition at line 225 of file MarkdownRenderer.Properties.cs.

◆ BoldFontFamily

FontFamily VectSharp.Markdown.MarkdownRenderer.BoldFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.HelveticaBold)
getset

The font family for bold text.

Definition at line 64 of file MarkdownRenderer.Properties.cs.

◆ BoldItalicFontFamily

FontFamily VectSharp.Markdown.MarkdownRenderer.BoldItalicFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.HelveticaBoldOblique)
getset

The font family for bold italic text.

Definition at line 74 of file MarkdownRenderer.Properties.cs.

◆ BoldUnderlineThickness

double VectSharp.Markdown.MarkdownRenderer.BoldUnderlineThickness = 0.15
getset

The thickness of underlines for bold text. This value will be multiplied by the font size of the element being underlined.

Definition at line 104 of file MarkdownRenderer.Properties.cs.

◆ Bullets

List<Action<Graphics, Colour> > VectSharp.Markdown.MarkdownRenderer.Bullets
get
Initial value:
= new List<Action<Graphics, Colour>>()
{
(graphics, colour) =>
{
graphics.FillPath(new GraphicsPath().Arc(-0.5, 0, 0.25, 0, 2 * Math.PI), colour);
},
(graphics, colour) =>
{
graphics.StrokePath(new GraphicsPath().Arc(-0.5, 0, 0.25, 0, 2 * Math.PI), colour, 0.1);
},
(graphics, colour) =>
{
graphics.StrokeRectangle(-0.75, -0.25, 0.5, 0.5, colour, 0.1);
},
}
Represents a graphics path that can be filled or stroked.
Definition: GraphicsPath.cs:29
GraphicsPath Arc(Point center, double radius, double startAngle, double endAngle)
Trace an arc segment from a circle with the specified center and radius , starting at startAngle an...

Bullet points used for unordered lists. Each element of this list corresponds to the bullet for each level of list indentation. If the list indentation is greater than the number of elements in this list, the bullet points will be reused cyclically. Each element of this list is a method taking two arguments: the first is the Graphics object on which the bullet point should be drawn, while the second is the colour in which it should be painted. The method should draw the bullet point centered around the origin. The size of the bullet point will be multiplied by the current font size.

Definition at line 266 of file MarkdownRenderer.Properties.cs.

◆ CodeBlockBackgroundColour

Colour VectSharp.Markdown.MarkdownRenderer.CodeBlockBackgroundColour = Colour.FromRgb(240, 240, 245)
getset

The background colour for code blocks.

Definition at line 350 of file MarkdownRenderer.Properties.cs.

◆ CodeFont

FontFamily VectSharp.Markdown.MarkdownRenderer.CodeFont = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.Courier)
getset

The font family for code elements.

Definition at line 79 of file MarkdownRenderer.Properties.cs.

◆ CodeFontBold

FontFamily VectSharp.Markdown.MarkdownRenderer.CodeFontBold = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.CourierBold)
getset

The font family for bold code elements.

Definition at line 84 of file MarkdownRenderer.Properties.cs.

◆ CodeFontBoldItalic

FontFamily VectSharp.Markdown.MarkdownRenderer.CodeFontBoldItalic = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.CourierBoldOblique)
getset

The font family for bold italic code elements.

Definition at line 94 of file MarkdownRenderer.Properties.cs.

◆ CodeFontItalic

FontFamily VectSharp.Markdown.MarkdownRenderer.CodeFontItalic = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.CourierOblique)
getset

The font family for italic code elements.

Definition at line 89 of file MarkdownRenderer.Properties.cs.

◆ CodeInlineBackgroundColour

Colour VectSharp.Markdown.MarkdownRenderer.CodeInlineBackgroundColour = Colour.FromRgb(240, 240, 240)
getset

The background colour for code inlines.

Definition at line 345 of file MarkdownRenderer.Properties.cs.

◆ CodeInlineMargin

double VectSharp.Markdown.MarkdownRenderer.CodeInlineMargin = 0.25
getset

The margin at the left and right of code inlines. This value will be multiplied by the current font size.

Definition at line 175 of file MarkdownRenderer.Properties.cs.

◆ EmojiUriResolver

Func<string, (string, bool)> VectSharp.Markdown.MarkdownRenderer.EmojiUriResolver
getset

A method used to resolve emojis. The argument of the method should be an emoji uri of the form "emoji://{name}_heading:{level}", where "{name}" is the name of the emoji and "{level}" is the heading level, or "unicode://{unicode}_heading:{level}", where "{unicode}" is a unicode surrogate pair. The method should return a tuple containing the path of a local file containing the rendered emoji and a boolean value indicating whether the file should be deleted after the program has finished using it.

Definition at line 220 of file MarkdownRenderer.Properties.cs.

◆ EmojiURLMapping

EmojiMapping VectSharp.Markdown.MarkdownRenderer.EmojiURLMapping = new EmojiMapping(new Dictionary<string, string>(EmojiMapping.GetDefaultEmojiShortcodeToUnicode().Select(x => new KeyValuePair<string, string>(x.Key, "emoji://" + x.Key.Trim(':')))), EmojiMapping.GetDefaultSmileyToEmojiShortcode())
staticget

Emoji mapping that transforms emojis (e.g. ":something:") into URLs (e.g., "emoji://something").

Definition at line 400 of file MarkdownRenderer.Properties.cs.

◆ ForegroundColour

Colour VectSharp.Markdown.MarkdownRenderer.ForegroundColour = Colours.Black
getset

The foreground colour for text elements.

Definition at line 320 of file MarkdownRenderer.Properties.cs.

◆ HeaderFontSizeMultipliers

double [] VectSharp.Markdown.MarkdownRenderer.HeaderFontSizeMultipliers
get
Initial value:
= new double[]
{
28 / 12.0, 22 / 12.0, 16 / 12.0, 14 / 12.0, 13 / 12.0, 12 / 12.0
}

The font size for elements at each header level. The values in this array will be multiplied by the BaseFontSize.

Definition at line 41 of file MarkdownRenderer.Properties.cs.

◆ HeaderLineColour

Colour VectSharp.Markdown.MarkdownRenderer.HeaderLineColour = Colour.FromRgb(180, 180, 180)
getset

The colour of the line below headers.

Definition at line 330 of file MarkdownRenderer.Properties.cs.

◆ HeaderLineThicknesses

double [] VectSharp.Markdown.MarkdownRenderer.HeaderLineThicknesses = new double[] { 1, 1, 0, 0, 0, 0 }
get

The thickness of the separator line after a header of each level. A value of 0 disables the line after headers of that level.

Definition at line 49 of file MarkdownRenderer.Properties.cs.

◆ ImageMarginTolerance

double VectSharp.Markdown.MarkdownRenderer.ImageMarginTolerance = 25
getset

Images will be allowed to extend into the page bottom margin area by this amount before triggering a page break. This should be smaller than the bottom margin, otherwise images risk being cut off by the page boundary.

Definition at line 255 of file MarkdownRenderer.Properties.cs.

◆ ImageMultiplier

double VectSharp.Markdown.MarkdownRenderer.ImageMultiplier = 1
getset

The size of images will be multiplied by this value to determine the actual size of the image on the page. For images that have a width or height attribute, this will be applied in addition to the ImageUnitMultiplier. For images without width and height, only this multiplier will be applied.

Definition at line 245 of file MarkdownRenderer.Properties.cs.

◆ ImageSideMargin

double VectSharp.Markdown.MarkdownRenderer.ImageSideMargin = 10
getset

The margin on the right of left-aligned images and on the left of right-aligned images.

Definition at line 250 of file MarkdownRenderer.Properties.cs.

◆ ImageUnitMultiplier

double VectSharp.Markdown.MarkdownRenderer.ImageUnitMultiplier = 0.60714
getset

The size of images (as defined in the image's width and height attributes) will be multiplied by this value to determine the actual size of the image on the page. This has no effect on images without a width or height attribute.

Definition at line 240 of file MarkdownRenderer.Properties.cs.

◆ ImageUriResolver

Func<string, string, (string, bool)> VectSharp.Markdown.MarkdownRenderer.ImageUriResolver = HTTPUtils.ResolveImageURI
getset

A method used to resolve (possibly remote) image uris into local file paths. The first argument of the method should be the image uri and the second argument the base uri used to resolve relative links. The method should return a tuple containing the path of the local file and a boolean value indicating whether the file has been fetched from a remote location and should be deleted after the program has finished using it.

Definition at line 215 of file MarkdownRenderer.Properties.cs.

◆ IndentWidth

double VectSharp.Markdown.MarkdownRenderer.IndentWidth = 40
getset

The indentation width used for list items.

Definition at line 180 of file MarkdownRenderer.Properties.cs.

◆ InsertedColour

Colour VectSharp.Markdown.MarkdownRenderer.InsertedColour = Colour.FromRgb(0, 158, 115)
getset

The colour for text that has been styled as "inserted".

Definition at line 365 of file MarkdownRenderer.Properties.cs.

◆ ItalicFontFamily

FontFamily VectSharp.Markdown.MarkdownRenderer.ItalicFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.HelveticaOblique)
getset

The font family for italic text.

Definition at line 69 of file MarkdownRenderer.Properties.cs.

◆ LinkColour

Colour VectSharp.Markdown.MarkdownRenderer.LinkColour = Colour.FromRgb(25, 140, 191)
getset

The colour for hypertext links.

Definition at line 340 of file MarkdownRenderer.Properties.cs.

◆ LinkUriResolver

Func<string, string> VectSharp.Markdown.MarkdownRenderer.LinkUriResolver = a => a
getset

A method used to resolve link addresses. The argument of the method should be the absolute link, and the method should return the resolved address. This can be used to "redirect" links to a different target.

Definition at line 230 of file MarkdownRenderer.Properties.cs.

◆ Margins

Margins VectSharp.Markdown.MarkdownRenderer.Margins = new Margins(55, 55, 55, 55)
getset

The margins of the page.

Definition at line 109 of file MarkdownRenderer.Properties.cs.

◆ MarkdownPipelineBuilder

MarkdownPipelineBuilder VectSharp.Markdown.MarkdownRenderer.MarkdownPipelineBuilder = new MarkdownPipelineBuilder().UseGridTables().UsePipeTables().UseEmphasisExtras().UseGenericAttributes().UseAutoIdentifiers().UseAutoLinks().UseTaskLists().UseListExtras().UseCitations().UseMathematics().UseSmartyPants().UseEmojiAndSmiley(EmojiURLMapping).UseUnicodeEmoji()
getset

Markdown pipeline builder used to parse markdown source.

Definition at line 405 of file MarkdownRenderer.Properties.cs.

◆ MarkedColour

Colour VectSharp.Markdown.MarkdownRenderer.MarkedColour = Colour.FromRgb(213, 94, 0)
getset

The colour for text that has been styled as "marked".

Definition at line 370 of file MarkdownRenderer.Properties.cs.

◆ MathFontScalingFactor

double VectSharp.Markdown.MarkdownRenderer.MathFontScalingFactor = 0.85
getset

Scaling factor for the font size to use when rendering math.

Definition at line 36 of file MarkdownRenderer.Properties.cs.

◆ PageSize

Size VectSharp.Markdown.MarkdownRenderer.PageSize = new Size(595, 842)
getset

The size of the page.

Definition at line 145 of file MarkdownRenderer.Properties.cs.

◆ QuoteBlockBackgroundColour

Colour VectSharp.Markdown.MarkdownRenderer.QuoteBlockBackgroundColour = Colour.FromRgb(240, 240, 255)
getset

The background colour for block quotes.

Definition at line 360 of file MarkdownRenderer.Properties.cs.

◆ QuoteBlockBarColour

Colour VectSharp.Markdown.MarkdownRenderer.QuoteBlockBarColour = Colour.FromRgb(75, 152, 220)
getset

The colour for the bar to the left of block quotes.

Definition at line 355 of file MarkdownRenderer.Properties.cs.

◆ QuoteBlockBarWidth

double VectSharp.Markdown.MarkdownRenderer.QuoteBlockBarWidth = 5
getset

The thickness of the bar to the left of block quotes.

Definition at line 190 of file MarkdownRenderer.Properties.cs.

◆ QuoteBlockIndentWidth

double VectSharp.Markdown.MarkdownRenderer.QuoteBlockIndentWidth = 30
getset

The indentation width used for block quotes.

Definition at line 185 of file MarkdownRenderer.Properties.cs.

◆ RasterImageLoader

Func<string, RasterImage> VectSharp.Markdown.MarkdownRenderer.RasterImageLoader = null
getset

A method used to a load raster image from a local file. The argument of the method should be the path of a local image file, and the method should return a RasterImage representing that file. For example, this can be achieved using the RasterImageFile class from the VectSharp.MuPDFUtils package. If this is null, only SVG images will be included in the document.

Definition at line 235 of file MarkdownRenderer.Properties.cs.

◆ RegularFontFamily

FontFamily VectSharp.Markdown.MarkdownRenderer.RegularFontFamily = FontFamily.ResolveFontFamily(FontFamily.StandardFontFamilies.Helvetica)
getset

The font family for regular text.

Definition at line 59 of file MarkdownRenderer.Properties.cs.

◆ SpaceAfterHeading

double VectSharp.Markdown.MarkdownRenderer.SpaceAfterHeading = 0.25
getset

The space after each heading. This value will be multiplied by the font size of the heading.

Definition at line 170 of file MarkdownRenderer.Properties.cs.

◆ SpaceAfterLine

double VectSharp.Markdown.MarkdownRenderer.SpaceAfterLine = 0.25
getset

The space after each line of text. This value will be multiplied by the BaseFontSize.

Definition at line 160 of file MarkdownRenderer.Properties.cs.

◆ SpaceAfterParagraph

double VectSharp.Markdown.MarkdownRenderer.SpaceAfterParagraph = 0.75
getset

The space after each text paragraph. This value will be multiplied by the BaseFontSize.

Definition at line 155 of file MarkdownRenderer.Properties.cs.

◆ SpaceBeforeHeading

double VectSharp.Markdown.MarkdownRenderer.SpaceBeforeHeading = 0.25
getset

The space before each heading. This value will be multiplied by the font size of the heading.

Definition at line 165 of file MarkdownRenderer.Properties.cs.

◆ SpaceBeforeParagaph

double VectSharp.Markdown.MarkdownRenderer.SpaceBeforeParagaph = 0
getset

The space before each text paragraph. This value will be multiplied by the BaseFontSize.

Definition at line 150 of file MarkdownRenderer.Properties.cs.

◆ SubscriptShift

double VectSharp.Markdown.MarkdownRenderer.SubscriptShift = 0.14
getset

The downwards shift in the baseline for subscript elements. This value will be multiplied by the current font size.

Definition at line 205 of file MarkdownRenderer.Properties.cs.

◆ SubSuperscriptFontSize

double VectSharp.Markdown.MarkdownRenderer.SubSuperscriptFontSize = 0.7
getset

The font size for subscripts and superscripts. This value will be multiplied by the current font size.

Definition at line 195 of file MarkdownRenderer.Properties.cs.

◆ SuperscriptShift

double VectSharp.Markdown.MarkdownRenderer.SuperscriptShift = 0.33
getset

The upwards shift in the baseline for superscript elements. This value will be multiplied by the current font size.

Definition at line 200 of file MarkdownRenderer.Properties.cs.

◆ SyntaxHighlighter

Func<string, string, List<List<FormattedString> > > VectSharp.Markdown.MarkdownRenderer.SyntaxHighlighter = VectSharp.Markdown.SyntaxHighlighter.GetSyntaxHighlightedLines
getset

A method used for syntax highlighting. The first argument should be the source code to highlight, while the second parameter is the name of the language to use for the highlight. The method should return a list of lists of FormattedStrings, with each list of FormattedStrings representing a line. For each code block, if the method returns null, no syntax highlighting is used.

Definition at line 260 of file MarkdownRenderer.Properties.cs.

◆ TableCellMargins

Margins VectSharp.Markdown.MarkdownRenderer.TableCellMargins = new Margins(5, 0, 5, 0)
getset

The margins for table cells.

Definition at line 114 of file MarkdownRenderer.Properties.cs.

◆ TableHeaderRowSeparatorColour

Colour VectSharp.Markdown.MarkdownRenderer.TableHeaderRowSeparatorColour = Colours.Black
getset

The colour for the line separating the table header row from normal rows.

Definition at line 375 of file MarkdownRenderer.Properties.cs.

◆ TableHeaderRowSeparatorThickness

double VectSharp.Markdown.MarkdownRenderer.TableHeaderRowSeparatorThickness = 2
getset

The thickness of the line separating the table header row from normal rows.

Definition at line 385 of file MarkdownRenderer.Properties.cs.

◆ TableHeaderSeparatorThickness

double VectSharp.Markdown.MarkdownRenderer.TableHeaderSeparatorThickness = 1
getset

The thickness of lines separating table rows from each other.

Definition at line 390 of file MarkdownRenderer.Properties.cs.

◆ TableRowSeparatorColour

Colour VectSharp.Markdown.MarkdownRenderer.TableRowSeparatorColour = Colour.FromRgb(180, 180, 180)
getset

The colour for lines separating table rows from each other.

Definition at line 380 of file MarkdownRenderer.Properties.cs.

◆ TableVAlign

VerticalAlignment VectSharp.Markdown.MarkdownRenderer.TableVAlign = VerticalAlignment.Middle
getset

The vertical alignment of table cells.

Definition at line 140 of file MarkdownRenderer.Properties.cs.

◆ TaskListCheckedBullet

Graphics VectSharp.Markdown.MarkdownRenderer.TaskListCheckedBullet
getset
Initial value:
= new Func<Graphics>(() =>
{
Graphics tbr = new Graphics();
GraphicsPath checkboxPath = new GraphicsPath().MoveTo(-0.7, -0.4).LineTo(-0.3, -0.4).Arc(-0.3, -0.2, 0.2, 3 * Math.PI / 2, 2 * Math.PI).LineTo(-0.1, 0.2).Arc(-0.3, 0.2, 0.2, 0, Math.PI / 2).LineTo(-0.7, 0.4).Arc(-0.7, 0.2, 0.2, Math.PI / 2, Math.PI).LineTo(-0.9, -0.2).Arc(-0.7, -0.2, 0.2, Math.PI, 3 * Math.PI / 2).Close();
tbr.FillPath(checkboxPath, Colour.FromRgb(240, 246, 249));
tbr.StrokePath(checkboxPath, Colour.FromRgb(0, 114, 178), 0.075);
GraphicsPath tickpath = new GraphicsPath().MoveTo(-0.75, -0.1).LineTo(-0.5, 0.15).LineTo(-0.1, -0.4);
tbr.StrokePath(new GraphicsPath().MoveTo(-0.5, 0.15).LineTo(-0.1, -0.4), Colour.FromRgb(240, 246, 249), 0.3, LineCaps.Round);
tbr.StrokePath(tickpath, Colour.FromRgb(0, 158, 115), 0.2, LineCaps.Round);
return tbr;
})()
LineCaps
Represents line caps.
Definition: Enums.cs:190

The bullet used for checked task list items.

Definition at line 301 of file MarkdownRenderer.Properties.cs.

◆ TaskListUncheckedBullet

Graphics VectSharp.Markdown.MarkdownRenderer.TaskListUncheckedBullet
getset
Initial value:
= new Func<Graphics>(() =>
{
Graphics tbr = new Graphics();
GraphicsPath checkboxPath = new GraphicsPath().MoveTo(-0.7, -0.4).LineTo(-0.3, -0.4).Arc(-0.3, -0.2, 0.2, 3 * Math.PI / 2, 2 * Math.PI).LineTo(-0.1, 0.2).Arc(-0.3, 0.2, 0.2, 0, Math.PI / 2).LineTo(-0.7, 0.4).Arc(-0.7, 0.2, 0.2, Math.PI / 2, Math.PI).LineTo(-0.9, -0.2).Arc(-0.7, -0.2, 0.2, Math.PI, 3 * Math.PI / 2).Close();
tbr.FillPath(checkboxPath, Colour.FromRgb(240, 246, 249));
tbr.StrokePath(checkboxPath, Colour.FromRgb(0, 114, 178), 0.075);
return tbr;
})()

The bullet used for unchecked task list items.

Definition at line 287 of file MarkdownRenderer.Properties.cs.

◆ ThematicBreakLineColour

Colour VectSharp.Markdown.MarkdownRenderer.ThematicBreakLineColour = Colour.FromRgb(180, 180, 200)
getset

The colour for thematic break lines.

Definition at line 335 of file MarkdownRenderer.Properties.cs.

◆ ThematicBreakThickness

double VectSharp.Markdown.MarkdownRenderer.ThematicBreakThickness = 2
getset

The thickness of thematic break lines.

Definition at line 54 of file MarkdownRenderer.Properties.cs.

◆ UnderlineThickness

double VectSharp.Markdown.MarkdownRenderer.UnderlineThickness = 0.075
getset

The thickness of underlines. This value will be multiplied by the font size of the element being underlined.

Definition at line 99 of file MarkdownRenderer.Properties.cs.

Event Documentation

◆ BlockRendered

EventHandler<BlockRenderedEventArgs> VectSharp.Markdown.MarkdownRenderer.BlockRendered

Invoked just after rendering a Block.

Definition at line 44 of file MarkdownRenderer.Events.cs.

◆ BlockRendering

EventHandler<BlockRenderingEventArgs> VectSharp.Markdown.MarkdownRenderer.BlockRendering

Invoked just before rendering a Block.

Definition at line 39 of file MarkdownRenderer.Events.cs.

◆ InlineRendered

EventHandler<InlineRenderedEventArgs> VectSharp.Markdown.MarkdownRenderer.InlineRendered

Invoked just after rendering an Inline.

Definition at line 54 of file MarkdownRenderer.Events.cs.

◆ InlineRendering

EventHandler<InlineRenderingEventArgs> VectSharp.Markdown.MarkdownRenderer.InlineRendering

Invoked just before rendering an Inline.

Definition at line 49 of file MarkdownRenderer.Events.cs.

◆ LineMeasured

EventHandler<LineMeasuredEventArgs> VectSharp.Markdown.MarkdownRenderer.LineMeasured

Invoked after content in a Line has been measured, but before deciding whether to render the line on the current page or on a new page.

Definition at line 59 of file MarkdownRenderer.Events.cs.

◆ LineRendered

EventHandler<LineEventArgs> VectSharp.Markdown.MarkdownRenderer.LineRendered

Invoked just after rendering a Line.

Definition at line 69 of file MarkdownRenderer.Events.cs.

◆ LineRendering

EventHandler<LineEventArgs> VectSharp.Markdown.MarkdownRenderer.LineRendering

Invoked just before rendering a Line, after a new page has been created if necessary.

Definition at line 64 of file MarkdownRenderer.Events.cs.

◆ PageFinished

EventHandler<PageFinishedEventArgs> VectSharp.Markdown.MarkdownRenderer.PageFinished

Invoked when a page is finished, before starting a new page (or at the end of the document).

Definition at line 34 of file MarkdownRenderer.Events.cs.

◆ PageStarted

EventHandler<PageStartedEventArgs> VectSharp.Markdown.MarkdownRenderer.PageStarted

Invoked when a new page is started.

Definition at line 29 of file MarkdownRenderer.Events.cs.


The documentation for this class was generated from the following files: