With our API, you can generate PDFs that include interactive fillable fields directly from your existing HTML input elements. Our API supports most of the standard HTML input types and a custom <pdfgate-signature-field /> tag for creating digital signature fields. You can also customize the appearance and behavior of each field using PDFGate's custom HTML attributes.
This guide explains how to add fillable form fields to your PDFs and provides code examples so you can quickly integrate them into your workflow.
The feature is available directly on our HTML to PDF generation endpoint. You simply have to include the enableFormFields parameter in your request, and the API will automatically generate your PDF with all of your specified interactive form fields.
<form>
<h3>Sample Fillable PDF Form</h3>
<label>
Full Name:
<input type="text" name="full_name" value="John Doe" />
</label>
<br />
<label>
Email:
<input type="email" name="email" value="[email protected]" />
</label>
<br />
<label>
Date of Birth:
<input type="date" name="birth_date" value="1990-05-25" pdfgate-datetime-format="dd/mm/yyyy" />
</label>
<br />
<label>
Subscribe to newsletter:
<input type="checkbox" name="newsletter" checked />
</label>
<br />
<label>
Signature:
<pdfgate-signature-field name="signature"></pdfgate-signature-field>
</label>
</form>curl \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
--request POST \
--data '{"pageSizeType":"a4","html":"paste_html","enableFormFields":true}' \
https://api.pdfgate.com/v1/generate/pdf \
-o output.pdf
Below is a list of all the available HTML input types you can convert. The Custom Attributes column defines the custom PDFGate attributes you can use for each input type, while the Standard HTML Attributes column describes the standard HTML attributes that the API uses to customize the PDF fillable fields.
Below is a list of all the custom PDFGate attributes you can apply to your HTML inputs to customize the PDF fields.
The fields pdfgate-datetime-format and pdfgate-max-length may not work as expected in all PDF readers. They are fully supported in readers that allow embedded JavaScript, such as Adobe Acrobat.
Below is a list of all the standard HTML input attributes that the PDFGate API considers when creating PDF fillable fields.