HTML files are widely used over the internet. In various cases, you need to convert HTML files to PDF documents. Accordingly, this article covers how to convert an HTML file to a PDF document on Linux in .NET.

HTML to PDF Converter API for Linux

Aspose.HTML for .NET API supports working with HTML files. You can easily configure the API by downloading the DLL files from the Downloads section or from the NuGet gallery by using the NuGet Package Manager extension for Visual Studio Code in Linux.

Convert HTML to PDF in Linux

You can convert an HTML file to a PDF file with the following steps:

  1. Specify paths for the input and output files.
  2. Initialize an HTMLDocument class object.
  3. Create an instance of the PdfRenderingOptions class.
  4. Create the PdfDevice object and specify the output file to render.
  5. Render HTML to PDF with RenderTo method.

The following code shows how to convert HTML to PDF file in .NET on Linux:

Output

HTML to PDF Linux

Explore Aspose.HTML for .NET API

Aspose.HTML for .NET API is a standalone API to create, edit, or convert HTML files programmatically using C#. You can explore several other features of the API by visiting the documentation.

Get Free License

You can evaluate Aspose.HTML for .NET API without any limitations by requesting a free temporary license.

Conclusion

In this article, you have learned how to convert an HTML webpage to a PDF file in Linux. You can use the code snippet to produce high fidelity output in your .NET-based applications. Moreover, please feel free to reach us out at the free support forum in case of any concerns.

See Also