How to use our HTML2PDF API Below you'll find basic examples for all major programming languages. With just a few lines of code you can convert any URL or HTML to PDF. You can find all options and examples in our API documentation and the description of the click to PDF links. PHP C# / .NET Java Python Ruby Perl cURL Wget JavaScript // the following code converts the URL https://example.com to PDF