Cart Licenses Contact Support Online Creator Login/Register
v 1.9.30

PDF Export for SurveyJS

SurveyJS PDF exporter library is an easy way to render SurveyJS Library surveys to PDF which can be emailed or printed.

Build Status Issues Closed issues


SurveyJS PDF exporter is represented by SurveyPDF object which is a SurveyModel descendant. It inherits all the functionality of SurveyJS Model and adds PDF export specific features.

  • Render all SurveyJS questions (textboxes, checkboxes, dropdowns, etc.) with results
  • Support of SurveyJS widgets and your own custom adorners
  • Generate PDF interactive forms which can be filled inside the PDF document
  • Automatic splitting into separate pages without cuts inside the questions
  • Customizable font and sizes of page and markdown text
  • Ability to draw header and footer with logo and company information
  • API to save PDF on disk or get PDF file via raw string


SurveyJS PDF Exporter example page 1 SurveyJS PDF Exporter example page 2

Usage (modern ES, modules)

import * as SurveyPDF from "survey-pdf";

Usage (ES5, scripts)

Add these scripts to your web page

<!-- jsPDF library -->
<script src=""></script>
<!-- SurveyJS Core library -->
<script src=""></script>
<!-- SurveyPDF Exporter library -->
<script src=""></script>

<!-- Uncomment next line to add html and markdown text support -->
<!-- <script src=""></script> -->
<!-- Uncomment next line to add IE11 support -->
<!-- <script src=""></script> -->

Also you may load any of SurveyJS with framework scripts without loading SurveyJS Core. Look at simple package dependency diagram

SurveyJS package dependency

Example of export SurveyJS library JSON to PDF

var options = {
  fontSize: 14,
  margins: {
    left: 10,
    right: 10,
    top: 18,
    bot: 10
//json is same as for SurveyJS Library
var surveyPDF = new SurveyPDF.SurveyPDF(json, options);

//uncomment next code to add html and markdown text support
/*var converter = new showdown.Converter();
surveyPDF.onTextMarkdown.add(function(survey, options) {
    var str = converter.makeHtml(options.text);
    str = str.substring(3);
    str = str.substring(0, str.length - 4);
    options.html = str;

surveyPDF.onRenderHeader.add(function(_, canvas) {
      "SurveyJS PDF | Please purchase a SurveyJS PDF developer license to use it in your app |",
    fontSize: 10



  • No support of dynamic elements (visibleIf, buttons, validators, etc.)
  • Implied DPI 72 when set questions width
  • Question Text input types supported: text, password, color
  • Question Radiogroup not able to set readOnly for separate items
  • Question Imagepicker imagefit is always fill
  • Question Html support restricted subset of html markup
  • Question File save files via RMB in Chrome only
  • Question Panel state is always expanded
  • Question Panel Dynamic mode is only list and state default