---
title: "Generate a PDF with a PDF form using JavaScript | Nutrient"
canonical_url: "https://www.nutrient.io/guides/web/pdf-generation/from-pdf-form/"
md_url: "https://www.nutrient.io/guides/web/pdf-generation/from-pdf-form.md"
last_updated: "2026-06-19T07:57:11.516Z"
description: "Discover how to easily generate PDFs from web forms. Enhance your workflow with our step-by-step guide on PDF creation and integration."
---

# Generate a PDF with a PDF form using JavaScript

With Nutrient, you can generate PDF files from a PDF form.

### Filling PDF form fields  programmatically using JavaScript

Nutrient Web SDK offers multiple options for filling form fields programmatically, each with a different set of tradeoffs.

- With Document Engine — For persisting, restoring, and synchronizing the form field values across multiple devices without needing to build it yourself.

- XFDF — For exporting to or importing from other readers.

- Instant JSON — For the most efficient way to export or import changes made.

- Manual API — For full control over extracting and saving the values of forms.

For more information on filling PDF form fields programmatically, see [our guide](https://www.nutrient.io/guides/web/forms/form-filling.md).

### Flattening form fields  using JavaScript

The process of flattening form fields consists of rendering them over the background of a page with their current value and removing their data from the document.

For more information on flattening form fields, see [our guide](https://www.nutrient.io/guides/web/forms/flatten.md).
---

## Related pages

- [Generate PDFs from images using JavaScript](/guides/web/pdf-generation/from-images.md)
- [Generate PDFs from a Word template using JavaScript](/guides/web/pdf-generation/from-word-template.md)
- [Generate PDF thumbnails using JavaScript](/guides/web/pdf-generation/thumbnail-preview.md)
- [JavaScript PDF generation library](/guides/web/pdf-generation.md)
- [Generate PDF reports using JavaScript](/guides/web/pdf-generation/pdf-reports.md)
- [Generate PDFs from a template using JavaScript](/guides/web/pdf-generation/from-pdf-template.md)
- [Headless PDF generation](/guides/web/pdf-generation/headless.md)

