Skip to content

# PDFSvgDrawing

Namespace: O2S.Components.PDF4NET.Graphics.Svg

Defines a SVG drawing.

    public class PDFSvgDrawing : O2S.Components.PDF4NET.Graphics.PDFFormXObject

Inheritance Object → PDFContentStreamContainer → PDFFormXObject → PDFSvgDrawing

## Constructors

### PDFSvgDrawing(String)

Initializes a new PDFSvgDrawing object.

    public PDFSvgDrawing(string fileName)

Parameters

`fileName` String
Path to source SVG document.

### PDFSvgDrawing(Stream)

Initializes a new PDFSvgDrawing object.

    public PDFSvgDrawing(Stream stream)

Parameters

`stream` Stream
Source stream with SVG document.

## Properties

### Canvas

Gets the form XObject graphics.

    public PDFCanvas Canvas { get; }

Property Value

PDFCanvas
The form XObject graphics surface.

### CosDictionary

Gets the COS dictionary asssociated with this object.

    public PDFCosDictionary CosDictionary { get; }

Property Value

PDFCosDictionary
The internal COS dictionary.

Remarks

Incorrect manipulation of the information in the COS dictionary can lead to invalid PDF files.

### DefaultBoldFont

Default font to be used for rendering SVG bold text in the PDF file.

    public PDFFont DefaultBoldFont { get; set; }

Property Value

PDFFont

### DefaultBoldItalicFont

Default font to be used for rendering SVG bold italic text in the PDF file.

    public PDFFont DefaultBoldItalicFont { get; set; }

Property Value

PDFFont

### DefaultItalicFont

Default font to be used for rendering SVG italic text in the PDF file.

    public PDFFont DefaultItalicFont { get; set; }

Property Value

PDFFont

### DefaultRegularFont

Default font to be used for rendering SVG text in the PDF file.

    public PDFFont DefaultRegularFont { get; set; }

Property Value

PDFFont

### Height

Gets the form XObject height.

    public double Height { get; }

Property Value

Double
The form XObject height in points.

### Matrix

Gets or sets the form XObject matrix.

    public PDFMatrix Matrix { get; set; }

Property Value

PDFMatrix
The matrix applied to form XObject content before it is rendered.

### Measure

Gets or sets the image measure.

    public PDFMeasure Measure { get; set; }

Property Value

PDFMeasure
A PDFMeasure descendant object that specifies the scale and units which shall apply to the image.

### PointData

Gets or sets the point data.

    public PDFPointData PointData { get; set; }

Property Value

PDFPointData
A PDFPointData object that specifies the extended geospatial data that shall apply to the image.

### StructureElement

Gets or sets the structure element that represents this form XObject.

    public PDFStructureElement StructureElement { get; set; }

Property Value

PDFStructureElement
A PDFStructureElement object representing this form XObject.

### TransparencyGroup

Gets or sets the transparency group associated with this object.

    public PDFGroupXObject TransparencyGroup { get; set; }

Property Value

PDFGroupXObject
The transparency group associated with this object.

### Width

Gets the form XObject width.

    public double Width { get; }

Property Value

Double
The form XObject width in points.

## Methods

### RenderSvgDrawing()

Renders the SVG document as PDF graphics.

    public void RenderSvgDrawing()

Remarks

This method performs an explicit rendering of the SVG content to PDF. After the rendering process the size of this PDFSvgDrawing object can be retrieved using the PDFFormXObject.Width and PDFFormXObject.Height properties.
An explicit call of this method is not required, the framework calls it when the SVG drawing is drawn on the target graphics surface.