Skip to content

Commit fef056d

Browse files
committed
Merge branch 'hotfix/hotfix-v33.1.44' of https://github.com/syncfusion-content/document-processing-docs into 1016957-ugh
# Conflicts: # Document-Processing/PDF/PDF-Library/NET/Working-with-Pages.md
2 parents 6267c0d + 2330aeb commit fef056d

49 files changed

Lines changed: 840 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Document-Processing-toc.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,9 @@
32333233
<li>
32343234
<a href="/document-processing/pdf/conversions/html-to-pdf/net/docker">Docker</a>
32353235
</li>
3236+
<li>
3237+
<a href="/document-processing/pdf/conversions/html-to-pdf/net/Convert-HTML-to-PDF-in-Windows-Server">Windows Server</a>
3238+
</li>
32363239
<li>
32373240
<a href="/document-processing/pdf/conversions/html-to-pdf/net/Convert-HTML-to-PDF-in-GCP">Google Cloud Platform (GCP)</a>
32383241
<ul>
@@ -7037,6 +7040,9 @@
70377040
<li>
70387041
<a href="/document-processing/powerpoint/powerpoint-library/net/Create-PowerPoint-Presentation-in-Azure-Functions-v4">Azure Functions v4</a>
70397042
</li>
7043+
<li>
7044+
<a href="/document-processing/powerpoint/powerpoint-library/net/Create-PowerPoint-Presentation-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
7045+
</li>
70407046
</ul>
70417047
</li>
70427048
<li>
@@ -7163,6 +7169,9 @@
71637169
<li>
71647170
<a href="/document-processing/powerpoint/powerpoint-library/net/Open-and-Save-PowerPoint-Presentation-in-Azure-Functions-v4">Azure Functions v4</a>
71657171
</li>
7172+
<li>
7173+
<a href="/document-processing/powerpoint/powerpoint-library/net/Open-and-Save-PowerPoint-Presentation-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
7174+
</li>
71667175
</ul>
71677176
</li>
71687177
<li>
@@ -7354,6 +7363,9 @@
73547363
<li>
73557364
<a href="/document-processing/powerpoint/conversions/powerpoint-to-image/net/Convert-PowerPoint-to-Image-in-Azure-Functions-v4">Azure Functions v4</a>
73567365
</li>
7366+
<li>
7367+
<a href="/document-processing/powerpoint/conversions/powerpoint-to-image/net/Convert-PowerPoint-to-Image-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
7368+
</li>
73577369
</ul>
73587370
</li>
73597371
<li>
@@ -7440,6 +7452,9 @@
74407452
<li>
74417453
<a href="/document-processing/powerpoint/conversions/powerpoint-to-pdf/net/Convert-PowerPoint-to-PDF-in-Azure-Functions-v4">Azure Functions v4</a>
74427454
</li>
7455+
<li>
7456+
<a href="/document-processing/powerpoint/conversions/powerpoint-to-pdf/net/Convert-PowerPoint-to-PDF-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
7457+
</li>
74437458
</ul>
74447459
</li>
74457460
<li>
@@ -7563,7 +7578,7 @@
75637578
<a href="/document-processing/powerpoint/conversions/powerpoint-to-pdf/net/Convert-PowerPoint-to-PDF-in-Azure-Functions-v4">Azure Functions v4</a>
75647579
</li>
75657580
<li>
7566-
<a href="/document-processing/powerpoint/conversions/powerpoint-to-image/net/Convert-PowerPoint-to-Image-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
7581+
<a href="/document-processing/powerpoint/conversions/powerpoint-to-pdf/net/Convert-PowerPoint-to-PDF-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
75677582
</li>
75687583
</ul>
75697584
</li>
@@ -7683,6 +7698,9 @@
76837698
<li>
76847699
<a href="/document-processing/powerpoint/conversions/powerpoint-to-image/net/Convert-PowerPoint-to-Image-in-Azure-Functions-v4">Azure Functions v4</a>
76857700
</li>
7701+
<li>
7702+
<a href="/document-processing/powerpoint/conversions/powerpoint-to-image/net/Convert-PowerPoint-to-Image-in-Azure-Functions-Flex-Consumption">Azure Functions Flex Consumption</a>
7703+
</li>
76867704
</ul>
76877705
</li>
76887706
<li>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Convert HTML to PDF on the Windows Server | Syncfusion
3+
description: Learn how to convert HTML to PDF on a Windows Server using IIS Manager with clear and simple guidance.
4+
platform: document-processing
5+
control: PDF
6+
documentation: UG
7+
keywords: create pdf on windows server, generate pdf on windows server, syncfusion html to pdf, host pdf converter in iis
8+
---
9+
10+
# Convert HTML to PDF on the Windows Server using IIS Manager
11+
12+
The Syncfusion<sup>&reg;</sup> HTML to PDF converter is a .NET library for converting webpages, SVG, MHTML, and HTML to PDF using C#. Using this library, convert HTML to PDF document on the Windows Server using IIS Manager.
13+
14+
## Steps to convert HTML to PDF on the windows server using IIS manager
15+
16+
Step 1: Create a new C# ASP.NET Web Application (.NET Framework) project.
17+
![Create ASP.NET MVC application](htmlconversion_images/aspnetmvc1.png)
18+
19+
Step 2: In the Create a new ASP.NET Web Application window, choose the MVC template and click Next to proceed.
20+
![Configuration window](htmlconversion_images/aspnetmvc3.png)
21+
22+
Step 3: Install [Syncfusion.HtmlToPdfConverter.Net.Windows](https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.Net.Windows) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org/).
23+
![NuGet Package](htmlconversion_images/nuget-package-window.png)
24+
25+
Step 4: Include the following namespaces in the HomeController.cs file.
26+
27+
{% highlight c# tabtitle="C#" %}
28+
29+
using Syncfusion.Pdf;
30+
using Syncfusion.HtmlConverter;
31+
using System.IO;
32+
33+
{% endhighlight %}
34+
35+
Step 5: Add a new button in the Index.cshtml as shown below.
36+
37+
{% highlight c# tabtitle="C#" %}
38+
39+
@{Html.BeginForm("ExportToPDF", "Home", FormMethod.Post);
40+
{
41+
<div>
42+
<input type="submit" value="Convert PDF" style="width:150px;height:27px" />
43+
</div>
44+
}
45+
Html.EndForm();
46+
}
47+
48+
{% endhighlight %}
49+
50+
Step 6: Add a new action method named ExportToPDF in HomeController.cs and include the below code example to convert HTML to PDF document using [Convert](https://help.syncfusion.com/cr/document-processing/Syncfusion.HtmlConverter.HtmlToPdfConverter.html#Syncfusion_HtmlConverter_HtmlToPdfConverter_Convert_System_String_) method in [HtmlToPdfConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.HtmlConverter.HtmlToPdfConverter.html) class.
51+
52+
{% highlight c# tabtitle="C#" %}
53+
54+
//Initialize HTML to PDF converter.
55+
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
56+
//Convert URL to PDF document.
57+
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
58+
//Create memory stream.
59+
MemoryStream stream = new MemoryStream();
60+
//Save the document to memory stream.
61+
document.Save(stream);
62+
document.Close(true);
63+
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "HTML-to-PDF.pdf");
64+
65+
{% endhighlight %}
66+
67+
Step 7: Run the project and verify that the HTML‑to‑PDF conversion functions correctly in the local environment.
68+
69+
## Publish the project to a Windows Server using IIS
70+
71+
Step 1: Publish the project to a local folder by right‑clicking the project, selecting **Publish**, choosing the **Folder** option, and clicking **Next**.
72+
![IIS Folder](htmlconversion_images/IIS-Folder.png)
73+
74+
Step 2: Provide the folder path where the project should be published.
75+
![IIS Folder Path](htmlconversion_images/IIS-Browser.png)
76+
77+
Step 3: After creating the publish profile, Visual Studio opens the Publish dashboard. Review the target location, configuration, and other settings, and adjust them if necessary. Once everything looks correct, click **Publish** to deploy the application to the selected destination.
78+
![IIS Publish](htmlconversion_images/IIS-Publish.png)
79+
80+
Step 4: It will generate and publish all necessary files to the local publish directory.
81+
![IIS Local Folder Path](htmlconversion_images/IIS-localfolder.png)
82+
83+
Step 5: Copy the published output folder to the server and host the application in IIS.
84+
i.Open **IIS Manager** on the server and create a new website.
85+
86+
ii.Enter a **site name** and select the **physical path** that points to the published output folder on the server.
87+
![IIS Website](htmlconversion_images/IIS-Website.png)
88+
89+
iii. Obtain the server’s IP address after adding the website in the local IIS server.
90+
91+
iv. From your local computer, browse the website using the server’s IP address and port number. Once the site loads successfully, export the webpage to PDF.
92+
![IIS Browser](htmlconversion_images/IIS-RunBrowser.png)
93+
94+
A complete working sample is available for download from [GitHub](https://github.com/SyncfusionExamples/html-to-pdf-csharp-examples/tree/master/ASP.NET%20Core).
95+
96+
Click the button to convert the Syncfusion<sup>&reg;</sup> webpage into a PDF document. The generated PDF will appear as shown below.
97+
![IIS Output document](htmlconversion_images/IIS-Output.png)
18.7 KB
Loading
29 KB
Loading
69.4 KB
Loading
25.7 KB
Loading
23.6 KB
Loading
58.3 KB
Loading
58.6 KB
Loading
74 KB
Loading

0 commit comments

Comments
 (0)