←Select platform

Version Property

Summary
Gets or sets the SVG version of the document.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public SvgVersion Version { get; set; } 
@property (nonatomic, assign) LTSvgVersion version; 
public SvgVersion getVersion() 
public void setVersion(SvgVersion version) 
public: 
property SvgVersion Version { 
   SvgVersion get(); 
   void set (    SvgVersion ); 
} 
Version # get and set (SvgDocument) 

Property Value

The SVG version of the document

Remarks

The initial version of Version depends on the original data and read from the SVG data directly.

Setting the value to a different value will be used when saving the document using SaveToFile or to SaveToStream.

Example

This example will convert an SVG file from version any version to 1.1

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
using Leadtools.Forms.DocumentWriters; 
using Leadtools.Svg; 
 
using Leadtools.Document.Writer; 
 
public void SvgVersionExample() 
{ 
   // Assume the SVG file is located here 
   string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Page1.svg"); 
   string dstFileName = Path.Combine(LEAD_VARS.ImagesDir, "Page1Version11.svg"); 
 
   // Load the SVG from file 
   using (SvgDocument document = SvgDocument.LoadFromFile(srcFileName, null)) 
   { 
      // Show the version 
      Console.WriteLine("Original version is: " + document.Version); 
      if (document.Version != SvgVersion.v11) 
      { 
         // Convert it 
         document.Version = SvgVersion.v11; 
      } 
 
      // Save it 
      document.SaveToFile(dstFileName, null); 
   } 
 
   // Check it 
   using (SvgDocument document = SvgDocument.LoadFromFile(dstFileName, null)) 
   { 
      Console.WriteLine("New version is: " + document.Version); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.Svg Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.