SurveyJS.Pdf 3.2.1

Prefix Reserved
dotnet add package SurveyJS.Pdf --version 3.2.1
                    
NuGet\Install-Package SurveyJS.Pdf -Version 3.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SurveyJS.Pdf" Version="3.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SurveyJS.Pdf" Version="3.2.1" />
                    
Directory.Packages.props
<PackageReference Include="SurveyJS.Pdf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SurveyJS.Pdf --version 3.2.1
                    
#r "nuget: SurveyJS.Pdf, 3.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SurveyJS.Pdf@3.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SurveyJS.Pdf&version=3.2.1
                    
Install as a Cake Addin
#tool nuget:?package=SurveyJS.Pdf&version=3.2.1
                    
Install as a Cake Tool

SurveyJS PDF Generator for ASP.NET Core and Blazor

Generate fillable or read-only PDF documents from SurveyJS form definitions, optionally populated with responses.

SurveyJS PDF Generator

This NuGet package supplies the JavaScript assets for browser-side PDF generation in ASP.NET Core and Blazor applications without an npm build step. It corresponds to the survey-pdf npm package.

SurveyJS PDF Generator requires a commercial developer license. See the licensing section below.

Installation

In your application's project directory, run:

dotnet add package SurveyJS.Pdf --version 3.2.1

Requires .NET 8 or later. Installs SurveyJS.Core automatically. Keep all SurveyJS packages on the same version.

Quick Start

Ensure your ASP.NET Core application serves static web assets from referenced packages. In a .NET 8 application, configure app.UseStaticFiles() in Program.cs. Keep the static asset configuration provided by newer ASP.NET Core templates.

SurveyJS PDF Generator requires jsPDF, which is not included in this NuGet package. Load it separately before PDF Generator:

<script src="_content/SurveyJS.Core/survey.core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jspdf@4.2.1/dist/jspdf.umd.min.js"></script>
<script src="_content/SurveyJS.Pdf/survey.pdf.min.js"></script>

You can host jsPDF locally instead of using the CDN.

PDF Generator does not require a stylesheet or the Form Library renderer.

Place the following button and initialization script in the page body:

<button id="downloadPdf" type="button">Download PDF</button>
<script>
  const surveyJson = {
    title: "Contact information",
    pages: [{
      elements: [{ type: "text", name: "fullName", title: "Your name" }]
    }]
  };

  document.getElementById("downloadPdf").addEventListener("click", async () => {
    try {
      const pdf = new SurveyPDF.SurveyPDF(surveyJson);
      pdf.data = { fullName: "Alex" };
      await pdf.save("contact-information.pdf");
    } catch (error) {
      console.error("PDF export failed", error);
    }
  });
</script>

Replace the sample JSON schema and response data with values from your application. Omit pdf.data for a blank form. Set pdf.readOnly = true before saving to generate read-only output.

For an interactive online form with PDF export, also install SurveyJS and load its renderer and styles. Use the interactive survey's data object as the PDF response data.

Browser CSS does not style the PDF—use the PDF Generator appearance APIs.

For document settings and appearance customization, see the following guides:

Using Blazor

Load the scripts in the host page and invoke your JavaScript export function through JS interop. Pass the form definition and responses as JSON. PDF generation runs in JavaScript in the browser.

Documentation and Support

Use the _content/ paths above in place of npm or CDN paths for the SurveyJS assets shown in the guides. Load jsPDF separately.

License

SurveyJS PDF Generator is a commercial product and requires a developer license. SurveyJS.Core is MIT-licensed. See SurveyJS licensing and the license activation instructions. jsPDF has its own license.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.2.1 29 10/13/2026
3.2.0 69 10/8/2026
3.1.2 97 10/5/2026