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);
Properties
Methods
Events
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
Specifies whether to compress the PDF document. Compressed documents do not support custom fonts.
Default value: false
- Type:
- boolean readonly
- Implemented in:
- IDocOptions
Font name.
Possible values:
"Helvetica"
(default)"Courier"
"Times"
"Symbol"
"ZapfDingbats"
"Segoe"
(requires additional configuration)- Custom font name
- Type:
- string readonly
- Implemented in:
- IDocOptions
- See also:
- fontSize
Font size in points.
Default value: 14
- Type:
- number readonly
- Implemented in:
- IDocOptions
- See also:
- fontName
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
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
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
Specifies whether the PDF document contains text in right-to-left languages.
Default value: false
- Type:
- boolean readonly
- Implemented in:
- IDocOptions
Page margins. Set this property to an object with the following fields: top
, bot
, left
, right
.
- Type:
- IMargin readonly
- Implemented in:
- IDocOptions
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
Page orientation.
Possible values:
"p"
(default) - Portrait orientation."l"
- Landscape orientation.
- Type:
- "p" | "l" readonly
- Implemented in:
- IDocOptions
- See also:
- format
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.