Documentation Docs
Documentation Docs

IDocOptions

PDF document configuration. Pass it as the second argument to the SurveyPDF constructor:

const surveyPdf = new SurveyPDF.SurveyPDF(surveyJson, pdfDocOptions);

// In modular applications:
import { SurveyPDF } from "survey-pdf";
const surveyPdf = new SurveyPDF(surveyJson, pdfDocOptions);
applyImageFit property

Specifies whether to apply the imageFit property to exported Image questions.

If you enable the applyImageFit property, the quality of images may be lower because they pass through several conversions. If applyImageFit is disabled, exported images fill the entire container and do not preserve their aspect ratio, but their quality remains the same because they are exported as is.

Type:
boolean readonly
Implemented in:
IDocOptions
compress property

Specifies whether to compress the PDF document. Compressed documents do not support custom fonts.

Default value: false

Type:
boolean readonly
Implemented in:
IDocOptions
fontName property

Font name.

Possible values:

Type:
string readonly
Implemented in:
IDocOptions
See also:
fontSize
fontSize property

Font size in points.

Default value: 14

Type:
number readonly
Implemented in:
IDocOptions
See also:
fontName
format property

Page format.

Possible values:

  • "a0" - "a10" ("a4" is default)
  • "b0" - "b10"
  • "c0" - "c10"
  • "dl"
  • "letter"
  • "government-letter"
  • "legal"
  • "junior-legal"
  • "ledger"
  • "tabloid"
  • "credit-card"
  • Array - custom page size in millimeters, for example, [210.0, 297.0].
Type:
string | {} readonly
Implemented in:
IDocOptions
See also:
orientation
haveCommercialLicense property

Removes watermarks from the exported document.

You can enable this property only if you have a SurveyJS PDF Generator commercial license. It is illegal to enable this property without a license.

Type:
boolean readonly
Implemented in:
IDocOptions
htmlRenderAs property

Specifies how to render HTML questions into PDF.

Possible values:

  • "standard" - Render HTML questions as selectable text.
  • "image" - Render HTML questions as images.
  • "auto" (default) - Select between the "standard" and "image" modes automatically based on the HTML content.

You can override this property for an individual HTML question. Set the question's renderAs property to "standard" or "image" in the survey JSON schema.

Type:
IHTMLRenderType readonly
Implemented in:
IDocOptions
isRTL property

Specifies whether the PDF document contains text in right-to-left languages.

Default value: false

Type:
boolean readonly
Implemented in:
IDocOptions
margins property

Page margins. Set this property to an object with the following fields: top, bot, left, right.

Type:
IMargin readonly
Implemented in:
IDocOptions
matrixRenderAs property

Specifies how to render Matrix, Matrix Dropdown, and Matrix Dynamic questions into PDF.

Possible values:

  • "list" - Render matrix-like questions as lists.
  • "auto" (default) - Render matrix-like questions as tables if they fit into the available space. Otherwise, render the questions as lists.

You can override this property for an individual matrix-like question. Set the question's renderAs property to "list" in the survey JSON schema.

Type:
"auto" | "list" readonly
Implemented in:
IDocOptions
orientation property

Page orientation.

Possible values:

  • "p" (default) - Portrait orientation.
  • "l" - Landscape orientation.
Type:
"p" | "l" readonly
Implemented in:
IDocOptions
See also:
format
readonlyRenderAs property

Specifies how to render read-only questions.

Possible values:

  • "text" - Render read-only questions as plain text and custom primitives.
  • "acroform" - Use Acrobat Forms (AcroForms) to render questions that support them. Other questions are rendered in "text" mode.
  • "auto" (default) - Prefer the "text" mode but use "acroform" for File question type and links.
Type:
"auto" | "text" | "acroform" readonly
Implemented in:
IDocOptions

Copyright © 2023 Devsoft Baltic OÜ. All rights reserved.

Why we use cookies.

This site uses cookies to make your browsing experience more convenient and personal. Cookies store useful information on your computer to help us improve the efficiency and relevance of our site for you. In some cases, they are essential to making the site work properly. By accessing this site, you consent to the use of cookies.

For more information, refer to DevSoft Baltic’ privacy policy and cookie policy.

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.