Skip to content

Commit cc33bd7

Browse files
committed
985014-ug: Resolved the given feedback.
1 parent 335a7e4 commit cc33bd7

13 files changed

+80
-62
lines changed

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/Assemblies-Required.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ Get the following required assemblies by downloading the HTML converter installe
7676
</tbody>
7777
</table>
7878

79-
N> HTML to PDF conversion is not supported in Silverlight, Windows Phone, WinRT, Universal, Xamarin and UWP applications
79+
N> HTML to PDF conversion is not supported in .NET MAUI, Xamarin, and UWP applications.
8080

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/Convert-HTML-to-PDF-in-AWS-Elastic-Beanstalk.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public IActionResult BlinkToPDF()
7171
MemoryStream stream = new MemoryStream();
7272
//Save the document to the memory stream.
7373
document.Save(stream);
74+
//Close the document
75+
document.Close(true);
7476
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "BlinkLinuxDockerAWSBeanstalk.pdf");
7577
}
7678

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/Convert-HTML-to-PDF-in-Azure-App-Service-Linux-with-docker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public ActionResult ExportToPDF()
8484
MemoryStream stream = new MemoryStream();
8585
//Save and close a PDF document.
8686
document.Save(stream);
87+
document.Close(true);
8788
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "URL_to_PDF.pdf");
8889
}
8990

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/Convert-HTML-to-PDF-in-Azure-Function-App-Container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post
6464
ms = new MemoryStream();
6565
// Save and close the PDF document
6666
document.Save(ms);
67-
document.Close();
67+
document.Close(true);
6868
}
6969
catch (Exception ex)
7070
{

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/Converting-HTML-to-PDF.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ blinkConverterSettings.ViewPortSize = new Syncfusion.Drawing.Size(1280, 0);
7373
htmlConverter.ConverterSettings = blinkConverterSettings;
7474
//Convert URL to PDF document.
7575
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
76-
//Create a filestream.
77-
FileStream fileStream = new FileStream("HTML-to-PDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
76+
7877
//Save and close the PDF document.
79-
document.Save(fileStream);
78+
document.Save("Output.pdf");
8079
document.Close(true);
8180

8281
{% endhighlight %}

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/NuGet-Packages-Required.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ ASP.NET MVC
108108
</tbody>
109109
</table>
110110

111-
N> 1. HTML to PDF conversion is not supported in Silverlight, Windows Phone, WinRT, Universal, Xamarin and UWP applications.
111+
N> 1. HTML to PDF conversion is not supported in .NET MAUI, Xamarin, and UWP applications.
112112
N> 2. Starting with v21.1.XX, The package structure is changed if you reference Syncfusion<sup>&reg;</sup> HTML to the PDF library from the NuGet feed. The Blink binaries paths are automatically added and do not need to add it manually. However, if you need to refer the blink binaries paths in your application manually, please use the BlinkPath in BlinkConverterSettings. Get the BlinkBinaries from the NuGet package runtime folder or get the binaries by installing the HTML converter installer.

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/aspnet-mvc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
6767
MemoryStream stream = new MemoryStream();
6868
//Save the document to memory stream.
6969
document.Save(stream);
70+
//Close the document
71+
document.Close(true);
7072
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "HTML-to-PDF.pdf");
7173

7274
{% endhighlight %}

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/blazor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public MemoryStream CreatePdf(string url)
5959
MemoryStream stream = new MemoryStream();
6060
//Save the document to memory stream.
6161
document.Save(stream);
62+
//Close the document
63+
document.Close(true);
6264
return stream;
6365
}
6466

@@ -233,6 +235,8 @@ public MemoryStream CreatePdf(string url)
233235
MemoryStream stream = new MemoryStream();
234236
//Save the document to memory stream.
235237
document.Save(stream);
238+
//Close the document
239+
document.Close(true);
236240
return stream;
237241
}
238242

@@ -430,6 +434,8 @@ public MemoryStream CreatePdf(string url)
430434
MemoryStream stream = new MemoryStream();
431435
//Save the document to memory stream.
432436
document.Save(stream);
437+
//Close the document
438+
document.Close(true);
433439
return stream;
434440
}
435441

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/features.md

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ using Syncfusion.HtmlConverter;
137137
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
138138
//Convert URL to Image
139139
Image image = htmlConverter.ConvertToImage("https://www.google.com");
140-
//Save and dispose the image file
141-
image[0].Save("Output.jpg");
142-
image[0].Dispose();
140+
//Save the image.
141+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData);
143142

144143
{% endhighlight %}
145144

@@ -152,9 +151,8 @@ using Syncfusion.HtmlConverter;
152151
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
153152
//Convert URL to Image
154153
Image[] image = htmlConverter.ConvertToImage("https://www.google.com");
155-
//Save and dispose the image file
156-
image[0].Save("Output.jpg");
157-
image[0].Dispose();
154+
//Save the image.
155+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData);
158156

159157
{% endhighlight %}
160158

@@ -167,10 +165,8 @@ Imports Syncfusion.HtmlConverter
167165
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter()
168166
'Convert URL to Image
169167
Dim image As Image[] = htmlConverter.ConvertToImage("https://www.google.com")
170-
'Save and dispose the image file
171-
image[0].Save("Output.jpg")
172-
173-
image[0].Dispose(True)
168+
'Save the image.
169+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData)
174170

175171
{% endhighlight %}
176172

@@ -208,9 +204,8 @@ string baseUrl = @"C:/Temp/HTMLFiles/";
208204

209205
//Convert HTML string to Image
210206
Image image = htmlConverter.ConvertToImage(htmlText, baseUrl);
211-
//Save and dispose the image file
212-
image[0].Save("Output.jpg");
213-
image[0].Dispose();
207+
//Save the image.
208+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData);
214209

215210
{% endhighlight %}
216211

@@ -227,10 +222,9 @@ string htmlText = "<html><body><img src=\"syncfusion_logo.gif\" alt=\"Syncfusion
227222
string baseUrl = @"C:/Temp/HTMLFiles/";
228223

229224
//Convert HTML string to Image
230-
Image[] image = htmlConverter.ConvertToImage(htmlText, baseUrl)
231-
//Save and dispose the image file
232-
image[0].Save("Output.jpg");
233-
image[0].Dispose();
225+
Image[] image = htmlConverter.ConvertToImage(htmlText, baseUrl);
226+
//Save the image.
227+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData);
234228

235229
{% endhighlight %}
236230

@@ -248,9 +242,8 @@ Dim baseUrl As String = "C:/Temp/HTMLFiles/"
248242

249243
'Convert HTML string to Image
250244
Dim image As Image[] = htmlConverter.Convert(htmlText, baseUrl)
251-
'Save and dispose the image file
252-
image[0].Save("Output.jpg")
253-
image[0].Dispose(True)
245+
'Save the image.
246+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData)
254247

255248
{% endhighlight %}
256249

@@ -2452,7 +2445,7 @@ N> EnableAutoScaling and GetHtmlBounds cannot be used simultaneously in the HTM
24522445
' Save the generated PDF document to a specified output file.
24532446
document.Save("Output.pdf")
24542447
' Close the document.
2455-
document.Close()
2448+
document.Close(True)
24562449

24572450
{% endhighlight %}
24582451

@@ -2646,9 +2639,8 @@ The Blink HTML converter support adding the image background from HTML to Image
26462639
htmlConverter.ConverterSettings = settings;
26472640
//Convert HTML to Image.
26482641
Image image = htmlConverter.ConvertToImage("Input.html");
2649-
//Save and dispose the image file
2650-
image[0].Save("Output.png");
2651-
image[0].Dispose();
2642+
//Save the image.
2643+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData);
26522644

26532645
{% endhighlight %}
26542646

@@ -2667,9 +2659,8 @@ The Blink HTML converter support adding the image background from HTML to Image
26672659
htmlConverter.ConverterSettings = settings
26682660
' Convert HTML to Image.
26692661
Dim image As Image = htmlConverter.ConvertToImage("Input.html")
2670-
' Save and dispose the image file
2671-
image[0].Save("Output.png")
2672-
image[0].Dispose()
2662+
' Save the image.
2663+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData)
26732664

26742665
{% endhighlight %}
26752666

@@ -2702,9 +2693,8 @@ N> EnableAutoScaling and GetHtmlBounds cannot be used simultaneously in the HTML
27022693
htmlConverter.ConverterSettings = blinkConverterSettings;
27032694
// Convert the HTML file to an image
27042695
Image image = htmlConverter.ConvertToImage(Path.GetFullPath("Input.html"));
2705-
//Save and dispose the image file
2706-
image[0].Save("Output.png");
2707-
image[0].Dispose();
2696+
//Save the image.
2697+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData);
27082698

27092699
{% endhighlight %}
27102700

@@ -2725,9 +2715,8 @@ N> EnableAutoScaling and GetHtmlBounds cannot be used simultaneously in the HTML
27252715
htmlConverter.ConverterSettings = blinkConverterSettings
27262716
' Convert the HTML file to an image
27272717
Dim image As Image = htmlConverter.ConvertToImage(Path.GetFullPath("Input.html"))
2728-
' Save and dispose the image file
2729-
image[0].Save("Output.png")
2730-
image[0].Dispose()
2718+
' Save the image
2719+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), image.ImageData)
27312720

27322721
{% endhighlight %}
27332722

Document-Processing/PDF/Conversions/HTML-To-PDF/NET/linux.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,12 @@ Step 4: Add code samples in Program.cs file to convert HTML to PDF document usi
6363

6464
//Initialize HTML to PDF converter.
6565
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
66-
BlinkConverterSettings settings = new BlinkConverterSettings();
67-
//Assign Blink settings to the HTML converter.
68-
htmlConverter.ConverterSettings = settings;
66+
6967
//Convert URL to PDF document.
7068
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
71-
FileStream fileStream = new FileStream("HTML-to-PDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
69+
7270
//Save and close a PDF document.
73-
document.Save(fileStream);
71+
document.Save("Output.pdf");
7472
document.Close(true);
7573

7674
{% endhighlight %}

0 commit comments

Comments
 (0)