PDFCrowd Blog

Product updates, tips & tricks

Converting HTML to PDF is a common requirement in Django applications - generating invoices, reports, certificates, or any printable document. This tutorial shows how to integrate PDFCrowd's HTML to PDF API into your Django views.

Users often need to export web pages as PDFs. The browser's window.print() function produces inconsistent results: CSS backgrounds are omitted, page breaks occur mid-element, and layout rendering differs from the screen display.

WebSave as PDF provides a client-side solution for adding PDF export to web applications. It captures the current page state directly in the browser. This guide covers integration for React, Preact, Vue, Angular, Svelte, Astro, and SolidJS.

This guide helps you migrate from the Save to PDF Link service to WebSave as PDF. The migration is straightforward and can be completed in a few simple steps.

Why migrate? Save to PDF Link is a legacy service that relies on the HTTP referrer header, which is increasingly unreliable due to browser privacy features and HTTPS policies. WebSave as PDF works more reliably and offers better customization options.

In our latest series, we've explored how to leverage the Pdfcrowd cloud-based API for converting web pages and HTML files to PDF, previously using languages such as C and C++. As Rust offers a safer alternative to these languages, this article will guide you through integrating the Pdfcrowd HTML to PDF API into your Rust applications to achieve robust document conversion solutions. You can download the complete source code from GitHub.

In this article, we will show how to convert a webpage or an HTML document to PDF in C using the Pdfcrowd API.

We will show the convert() function that provides the conversion functionality. We will demonstrate how to use it to create PDF from various input sources, such as a URL, a local HTML file, or an HTML string. By the end of this article, you should have a good understanding of how to integrate the Pdfcrowd API into your C programs for HTML to PDF conversion.

The API is cloud-based and accessible over HTTP. We will use libcurl to communicate with the API. libcurl is a widely used library available on all major platforms.

To quickly incorporate the Pdfcrowd API into your own code, you can download the complete C code with examples.

This screencast will show you how to easily create a PDF document from a HTML file or a web page in PHP. You will also learn how to serve the PDF file from your PHP web application and download it in the browser.

 

The Pdfcrowd HTML to PDF API makes it easy to programmatically create fillable PDF forms from standard HTML forms. The API supports most of the HTML form features and, together with support for digital signatures (see Create Digital Signature in PDF), provides an easy way to create PDF forms.

This feature is available starting with Pdfcrowd API client libraries version 5.6.

Simple Example

Add an HTML form field, for example a text input:

<p>Enter name: <input type="text"></p>

Enable generation of fillable PDF forms with the setEnablePdfForms() method:

client.setEnablePdfForms(true)

The resulting PDF will display an interactive input text field.

See: Example PDF, HTML and Code