Skip to content

Commit f549d4e

Browse files
committed
957177: Resolved the given feedback.
1 parent 4fbd3fb commit f549d4e

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

  • HTML to PDF/Blink/Converting_SVG_to_Image_using_HtmlConverter/.NET/Converting_SVG_to_Image_using_HtmlConverter
Lines changed: 11 additions & 4 deletions
Loading

HTML to PDF/Blink/Converting_SVG_to_Image_using_HtmlConverter/.NET/Converting_SVG_to_Image_using_HtmlConverter/Program.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
55
string svg = File.ReadAllText(Path.GetFullPath(@"Data/Input.svg"));
6-
Image images = htmlConverter.ConvertToImage(svg, "");
7-
byte[] imageByte = images.ImageData;
8-
//Save the image
9-
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), imageByte);
6+
// Convert the SVG content to an image using the converter
7+
Image image = htmlConverter.ConvertToImage(svg, "");
8+
9+
// Extract the image data as a byte array
10+
byte[] imageBytes = image.ImageData;
11+
12+
// Save the image data to a file in JPEG format
13+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), imageBytes);

0 commit comments

Comments
 (0)