In this example, we are going to see how to convert HTML to PDF using C++. HTML to PDF conversion is frequently required feature and you can easily achieve this by writing few lines of code in C++.
Steps to Convert HTML to PDF using C++
- Use Aspose.Words.Cpp NuGet package
- Include reference to Aspose::Words and Saving namespaces
- Create a new Document Class instance
- Save the HTMl to PDF in C++ by using Save method
In the following example, you can easily render HTML to PDF using C++ without any external dependencies and with few simple steps and code.
Code to Convert HTML to PDF using C++
In previous example, we learnt How to Create Word Document in C++. Now, we have seen how in C++, HTML to PDF is rendered. This example makes creating word document a lot easier and quicker along with no dependency on Microsoft platform.