←Select platform

SvgDocument Property

Summary
The SVG document representation of the page.
Syntax
C#
VB
Objective-C
C++
Java
public ISvgDocument SvgDocument { get; set; } 
Public Property SvgDocument As ISvgDocument 
@property (nonatomic, strong) id<ISvgDocument> svgDocument 
public ISvgDocument getSvgDocument() 
public void setSvgDocument(ISvgDocument svgDocument) 
public: 
property ISvgDocument^ SvgDocument { 
   ISvgDocument^ get(); 
   void set (    ISvgDocument^ ); 
} 

Property Value

An SvgDocument that contains the SVG document representation of the page.

Remarks

The SvgDocument property must contain an ISvgDocument object --it cannot be null. This SVG document is used in the DocumentWriter.AddPage or DocumentWriter.InsertPage methods to create the visual representation of the new page added to the document being created.

The LEADTOOLS Document Writer toolkit will not use the ISvgDocument object after the call to DocumentWriter.AddPage or DocumentWriter.InsertPage returns. This handle needs to be disposed to free the resources associated with it by the user.

The SVG objects can be obtained from multiple sources as explained in LEADTOOLS Document Writers.

SVG documents may or may not have a size. If a document has a size, it is stored in the width and height attributes of the root svg element and can be in any coordinate system. An SVG renderer will typically use this value to determine the final bounding rectangle of the document. SVG documents contain a hierarchy of elements. The final transformation (such as position and size) and style (such as color and fill) may depend on the transformation and style of the parent(s) inside the hierarchy. Calculations have to be done to keep track of this information when converting the SVG file. This procedure is defined by LEADTOOLS as flattening the document.

The DocumentWriterSvgPage.Width and DocumentWriterSvgPage.Height properties can be used to set a custom page size in inches. When the values are the default of 0, the framework will obtain the page width and height automatically from the ISvgDocument object set in SvgDocument when AddPage is called. If it is desired to create pages at a custom size, then simply set the values (in inches) in DocumentWriterSvgPage.Width and DocumentWriterSvgPage.Height before calling AddPage.

The LEADTOOLS Document Writer supports creating documents with zero or more empty pages inside them. Simply pass a page of type DocumentWriterEmptyPage to DocumentWriter.AddPage or DocumentWriter.InsertPage methods. The dimension of the empty page must be set before hand in the DocumentOptions.EmptyPageWidth and DocumentOptions.EmptyPageHeight and its resolution set to DocumentOptions.EmptyPageResolution. As many empty pages as desired can be added and in any index desired. To use empty pages, make sure the DocumentOptions.PageRestriction property is set to DocumentPageRestriction.Relaxed.

Example

For an example, refer to DocumentWriter.

Requirements

Target Platforms

Help Version 21.0.2021.6.30
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Writer Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.