VectSharp  2.2.1
A light library for C# vector graphics
VectSharp.SVG.SVGContextInterpreter Class Reference

Contains methods to render a Page as an SVG file. More...

Classes

class  FilterOption
 Determines how and whether image filters are rasterised. More...
 

Public Types

enum  TextOptions { TextOptions.EmbedFonts, TextOptions.SubsetFonts, TextOptions.ConvertIntoPaths, TextOptions.DoNotEmbed }
 Defines whether the used fonts should be included in the file. More...
 

Static Public Member Functions

static void SaveAsSVG (this Page page, string fileName, TextOptions textOption=TextOptions.SubsetFonts, Dictionary< string, string > linkDestinations=null, FilterOption filterOption=default)
 Render the page to an SVG file. More...
 
static void SaveAsSVG (this Page page, Stream stream, TextOptions textOption=TextOptions.SubsetFonts, Dictionary< string, string > linkDestinations=null, FilterOption filterOption=default)
 Render the page to an SVG stream. More...
 

Detailed Description

Contains methods to render a Page as an SVG file.

Definition at line 1608 of file SVGContext.cs.

Member Enumeration Documentation

◆ TextOptions

Defines whether the used fonts should be included in the file.

Enumerator
EmbedFonts 

Embeds the full font files.

SubsetFonts 

Embeds subsetted font files containing only the glyphs for the characters that have been used.

ConvertIntoPaths 

Does not embed any font file and converts all text items into paths.

DoNotEmbed 

Does not embed any font file, but still encodes text items as such.

Definition at line 1630 of file SVGContext.cs.

Member Function Documentation

◆ SaveAsSVG() [1/2]

static void VectSharp.SVG.SVGContextInterpreter.SaveAsSVG ( this Page  page,
Stream  stream,
TextOptions  textOption = TextOptions.SubsetFonts,
Dictionary< string, string >  linkDestinations = null,
FilterOption  filterOption = default 
)
static

Render the page to an SVG stream.

Parameters
pageThe Page to render.
streamThe stream to which the SVG data will be written.
textOptionDefines whether the used fonts should be included in the file.
linkDestinationsA dictionary associating element tags to link targets. If this is provided, objects that have been drawn with a tag contained in the dictionary will become hyperlink to the destination specified in the dictionary. If the destination starts with a hash (#), it is interpreted as the tag of another object in the current document; otherwise, it is interpreted as an external URI.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.

Definition at line 1736 of file SVGContext.cs.

◆ SaveAsSVG() [2/2]

static void VectSharp.SVG.SVGContextInterpreter.SaveAsSVG ( this Page  page,
string  fileName,
TextOptions  textOption = TextOptions.SubsetFonts,
Dictionary< string, string >  linkDestinations = null,
FilterOption  filterOption = default 
)
static

Render the page to an SVG file.

Parameters
pageThe Page to render.
fileNameThe full path to the file to save. If it exists, it will be overwritten.
textOptionDefines whether the used fonts should be included in the file.
linkDestinationsA dictionary associating element tags to link targets. If this is provided, objects that have been drawn with a tag contained in the dictionary will become hyperlink to the destination specified in the dictionary. If the destination starts with a hash (#), it is interpreted as the tag of another object in the current document; otherwise, it is interpreted as an external URI.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.

Definition at line 1619 of file SVGContext.cs.


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