Skip to content

Commit 828da6d

Browse files
Merge pull request #1756 from syncfusion-content/865893
865893: Need to add the UG documentation for Scale property in HTML converter.
2 parents 1535c88 + 500414f commit 828da6d

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

File-Formats/PDF/Convert-HTML-To-PDF/features.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,4 +2079,57 @@ document.Close(True)
20792079

20802080
{% endtabs %}
20812081

2082-
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/HTML%20to%20PDF/Blink/Set_blink_path_in_HTML_to_PDF).
2082+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/HTML%20to%20PDF/Blink/Set_blink_path_in_HTML_to_PDF).
2083+
2084+
## Scale
2085+
Resizing the HTML content within a PDF can be achieved through the utilization of the [Scale](https://help.syncfusion.com/cr/file-formats/Syncfusion.HtmlConverter.BlinkConverterSettings.html#Syncfusion_HtmlConverter_BlinkConverterSettings_Scale) property of Blink in HTML Converter.
2086+
2087+
N> The scaling factor should be within the range of 0.1 to 2.0.
2088+
2089+
Refer to the following code snippet to resize the page content size.
2090+
2091+
{% tabs %}
2092+
2093+
{% highlight c# tabtitle="C# [Cross-platform]" %}
2094+
2095+
//Initialize the HTML to PDF converter.
2096+
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
2097+
//Initialize the blink converter settings.
2098+
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
2099+
//Set the Scale.
2100+
blinkConverterSettings.Scale = 1.0f;
2101+
//Assign the Blink converter settings to the HTML converter.
2102+
htmlConverter.ConverterSettings = blinkConverterSettings;
2103+
//Convert the URL to a PDF document.
2104+
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
2105+
//Create a file stream.
2106+
FileStream fileStream = new FileStream("HTMLtoPDF.pdf", FileMode.Create, FileAccess.ReadWrite);
2107+
//Save a PDF document to a file stream.
2108+
document.Save(fileStream);
2109+
//Close the document.
2110+
document.Close(true);
2111+
2112+
{% endhighlight %}
2113+
2114+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
2115+
2116+
'Initialize the HTML to PDF converter.
2117+
Dim htmlConverter As New HtmlToPdfConverter()
2118+
'Initialize the blink converter settings.
2119+
Dim blinkConverterSettings As New BlinkConverterSettings()
2120+
'Set the Scale.
2121+
blinkConverterSettings.Scale = 1.0F
2122+
'Assign the Blink converter settings to HTML converter.
2123+
htmlConverter.ConverterSettings = blinkConverterSettings
2124+
'Convert the URL to a PDF document.
2125+
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com")
2126+
'Save a PDF document to a file stream.
2127+
document.Save("HTMLtoPDF.pdf")
2128+
'Close the document.
2129+
document.Close(True)
2130+
2131+
{% endhighlight %}
2132+
2133+
{% endtabs %}
2134+
2135+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/HTML%20to%20PDF/Blink/HTML-to-PDF-scale-property).

0 commit comments

Comments
 (0)