SurveyJS PDF Generator Overview

SurveyJS PDF Generator is a JavaScript library for generating editable and read-only PDF documents from SurveyJS JSON form definitions. Use it to create fillable PDF forms for offline completion, export completed forms and survey results, or produce printable copies of blank forms.

PDF Generator uses the same JSON form definition as SurveyJS Form Library. It supports React, Angular, Vue, and plain JavaScript applications and can generate PDF files entirely in the browser or on a Node.js server. Form definitions and response data are processed locally and do not need to be sent to SurveyJS.

Survey PDF Generator

How PDF Generator Works

SurveyJS PDF Generator creates a PDF document from a SurveyJS JSON form definition. You can generate a blank form or populate it with collected response data before export.

A typical workflow is as follows:

  1. Create or load a SurveyJS JSON form definition.
  2. Instantiate a SurveyPDF model from the form definition.
  3. Optionally assign collected response data to the model.
  4. Configure the document format, appearance, layout, and rendering behavior.
  5. Generate an editable PDF form or a static, read-only document.
  6. Download the PDF in the browser or generate it on a Node.js server.

Because PDF Generator extends the survey model from survey-core, it uses the same form structure, conditional visibility, expressions, localization, and value formatting as Form Library. The same JSON definition can be created in Survey Creator, rendered as a web form, and exported as a PDF without maintaining a separate document schema.

Key Features

PDF Generation and Export

Form Content and Rendering

PDF Appearance and Layout

The theme and layout systems are independent. A theme defines shared visual properties such as colors and elevation, while a PDF layout controls document-specific properties such as spacing and typography. This separation lets web forms and PDF documents use the same visual identity while retaining layouts suited to their respective formats. See PDF Appearance Customization for details.

Editable and Read-Only PDF Documents

By default, PDF Generator creates an interactive AcroForm that respondents can complete offline in a compatible PDF viewer. Set the readOnly property to true to generate a static PDF instead. See Customize PDF Form Settings for available options.

Localization

  • Generate PDFs in any locale supported by the form definition
  • Preserve translated questions, choices, descriptions, and other form content
  • Apply localized value formatting from the survey model
  • Embed custom fonts for languages and character sets not covered by the default font
  • Support right-to-left form content with the applicable PDF configuration

Existing PDF Form Integration

PDF Generator also includes the pdf-form-filler module for transferring SurveyJS response data into an existing PDF form template.

This workflow differs from generating a document with SurveyPDF: SurveyPDF creates a new PDF from a SurveyJS JSON form definition, while pdf-form-filler maps collected responses to fields in an existing PDF. Use it when an organization already has a standardized PDF template that must remain unchanged.

See Fill a PDF Form with Web Form Responses for implementation details.

Explore the PDF Generator demos with editable source code for document generation, appearance customization, headers and footers, and other export scenarios.

Installation

Install SurveyJS PDF Generator using npm:

npm install survey-pdf

Then follow the setup guide for your framework or runtime:

Package Architecture

The survey-pdf package extends the framework-independent survey model from survey-core and uses jsPDF to generate PDF documents.

survey-core provides the form model, conditional logic, expressions, localization, and value formatting. PDF Generator interprets that model and renders it as PDF content instead of HTML. Because PDF generation does not depend on a framework-specific UI renderer, the same package works with React, Angular, Vue, plain JavaScript, and Node.js applications.

PDF Generator can generate files in the browser or on a Node.js server. In both cases, your application controls how form definitions and response data are stored, retrieved, secured, and processed.

PDF Rendering Limitations

PDF and browser layouts use different rendering models. The following limitations apply to generated PDF documents:

  • Dynamic browser behavior such as validation feedback and navigation buttons is not included in PDF output.
  • Element widths are calculated at an implied screen resolution of 72 dpi.
  • Text questions support the text, password, and color input types.
  • Radiogroup questions do not support individual read-only choices.
  • Image Picker questions always use "fill" for imageFit.
  • HTML questions support a restricted subset of HTML.
  • Panels cannot be collapsed.
  • Dynamic panels support the "list" display mode and cannot be collapsed.

See Question Rendering in PDF Forms for PDF-specific rendering behavior and supported configurations.

Releases and Updates

Visit the Major Updates, Release Notes, and Roadmap pages for recent features, fixes, and planned improvements.

For major-version upgrades, refer to the relevant migration guide.

Licensing

SurveyJS PDF Generator requires a commercial license for production use. A developer license is required for each software developer who works with the SurveyJS PDF Generator APIs or implements its integration.

Send feedback to the SurveyJS team

Need help? Visit our support page

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.