Skip to content

Commit 781936d

Browse files
Updates
1 parent e6ddf3d commit 781936d

File tree

2 files changed

+7
-28
lines changed
  • content/english/net/canvas-and-image-manipulation
    • convert-svg-to-image-dotnet-aspose-html
    • convert-svg-to-pdf-dotnet-aspose-html

2 files changed

+7
-28
lines changed

content/english/net/canvas-and-image-manipulation/convert-svg-to-image-dotnet-aspose-html/_index.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,13 @@ Before we embark on this SVG to image conversion journey, make sure you have the
2222

2323
## Importing Namespaces
2424

25-
To get started, you'll need to import the necessary namespaces in your .NET project. These namespaces will enable you to use Aspose.HTML for .NET effectively. Here's how you can do it:
25+
26+
The first step is to import the necessary namespaces for your project. This allows your code to access the functionality provided by the Aspose.HTML for .NET library.
2627

2728
```csharp
28-
// ExStart:1
29-
// The path to the documents directory
30-
string dataDir = "Your Data Directory";
31-
// Source SVG document
32-
SVGDocument svgDocument = new SVGDocument(dataDir + "input.svg");
33-
// Initialize ImageSaveOptions
34-
ImageSaveOptions options = new ImageSaveOptions(ImageFormat.Jpeg);
35-
// Output file path
36-
string outputFile = dataDir + "SVGtoImage_Output.jpeg";
37-
// Convert SVG to Image
38-
Converter.ConvertSVG(svgDocument, options, outputFile);
39-
// ExEnd:1
29+
using Aspose.Html;
30+
using Aspose.Html.Rendering.Image;
31+
using Aspose.Html.Converters;
4032
```
4133

4234
Now, let's break down each step and explain it in detail.

content/english/net/canvas-and-image-manipulation/convert-svg-to-pdf-dotnet-aspose-html/_index.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,8 @@ Now, let's start with the code and break it down into multiple steps to ensure y
2727
To work with Aspose.HTML for .NET, you need to import the relevant namespaces. Here's how you do it:
2828

2929
```csharp
30-
// ExStart:1
31-
// The path to the documents directory
32-
string dataDir = "Your Data Directory";
33-
// Source SVG document
34-
SVGDocument svgDocument = new SVGDocument(dataDir + "input.svg");
35-
// Initialize pdfSaveOptions
36-
PdfSaveOptions options = new PdfSaveOptions()
37-
{
38-
JpegQuality = 100
39-
};
40-
// Output file path
41-
string outputFile = dataDir + "SVGtoPDF_Output.pdf";
42-
// Convert SVG to PDF
43-
Converter.ConvertSVG(svgDocument, options, outputFile);
44-
// ExEnd:1
30+
using Aspose.Html;
31+
using Aspose.Html.Converters;
4532
```
4633

4734
Now, let's break this code down into multiple steps.

0 commit comments

Comments
 (0)