You may try using either of the following approach to convert HTML files to PDF format.
DOM approach
You can load HTML file to Document object and save the output as PDF format. Please take a look over following code snippet.
[C#]
// load HTML contents
Aspose.Pdf.Document source = new Aspose.Pdf.Document("c:/pdftest/CRWU-NDWAC-Final-Report.html", new HtmlLoadOptions());
// save output as PDF format
source.Save("c:/pdftest/ResultantFile.pdf");
BindHTML(…)
The BindHTML(…) method can be used when you need to convert HTML contents to PDF format.
InLineHTML
You may consider using this approach when you need to render HTML tags as they appear in Web browser and place HTML text along with other PDF objects. When using this approach, you can also read the source HTML file and place the contents inside PDF file.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.