Documentation Docs
Documentation Docs

SurveyPDF

The SurveyPDF object enables you to export your surveys and forms to PDF documents.

View Demo

An event that is raised when SurveyJS PDF Generator renders a page footer. Handle this event to customize the footer.

Parameters:

  • sender: SurveyPDF
    A SurveyPDF instance that raised the event.

  • canvas: DrawCanvas
    An object that you can use to draw text and images in the page footer.

View Demo

Type:
EventAsync<SurveyPDF, DrawCanvas>
Implemented in:
SurveyPDF

An event that is raised when SurveyJS PDF Generator renders a page header. Handle this event to customize the header.

Parameters:

  • sender: SurveyPDF
    A SurveyPDF instance that raised the event.

  • canvas: DrawCanvas
    An object that you can use to draw text and images in the page header.

View Demo

Type:
EventAsync<SurveyPDF, DrawCanvas>
Implemented in:
SurveyPDF
onRenderPage event

An event that is raised when SurveyJS PDF Generator renders a page. Handle this event to customize page rendering.

Parameters:

  • sender: SurveyPDF
    A SurveyPDF instance that raised the event.

  • options.page: PageModel
    A page that is being rendered.

  • options.point: IPoint
    An object with coordinates of the top-left corner of the element being rendered. This object contains the following properties: { xLeft: number, yTop: number }.

  • options.bricks: PdfBrick[]
    An array of bricks used to render the element.

  • options.controller: DocController
    An object that provides access to main PDF document properties (font, margins, page width and height) and allows you to modify them.

  • options.repository: FlatRepository
    A repository with classes that render elements to PDF. Use its create method if you need to create a new instance of a rendering class.

View Demo

Type:
EventAsync<SurveyPDF, AdornersPageOptions>
Implemented in:
SurveyPDF

An event that is raised when SurveyJS PDF Generator renders a panel. Handle this event to customize panel rendering.

Parameters:

  • sender: SurveyPDF
    A SurveyPDF instance that raised the event.

  • options.panel: PanelModel
    A panel that is being rendered.

  • options.point: IPoint
    An object with coordinates of the top-left corner of the element being rendered. This object contains the following properties: { xLeft: number, yTop: number }.

  • options.bricks: PdfBrick[]
    An array of bricks used to render the element.

  • options.controller: DocController
    An object that provides access to main PDF document properties (font, margins, page width and height) and allows you to modify them.

  • options.repository: FlatRepository
    A repository with classes that render elements to PDF. Use its create method if you need to create a new instance of a rendering class.

View Demo

Type:
EventAsync<SurveyPDF, AdornersPanelOptions>
Implemented in:
SurveyPDF

An event that is raised when SurveyJS PDF Generator renders a survey question. Handle this event to customize question rendering.

Parameters:

  • sender: SurveyPDF
    A SurveyPDF instance that raised the event.

  • options.question: Question
    A survey question that is being rendered.

  • options.point: IPoint
    An object with coordinates of the top-left corner of the element being rendered. This object contains the following properties: { xLeft: number, yTop: number }.

  • options.bricks: PdfBrick[]
    An array of bricks used to render the element.

  • options.controller: DocController
    An object that provides access to main PDF document properties (font, margins, page width and height) and allows you to modify them.

  • options.repository: FlatRepository
    A repository with classes that render elements to PDF. Use its create method if you need to create a new instance of a rendering class.

View Demo

Type:
EventAsync<SurveyPDF, AdornersOptions>
Implemented in:
SurveyPDF
raw method

An asynchronous method that allows you to get PDF content in different formats.

View Demo

Type:
(type?: string) => any
Parameters:
type, type: string ,

(Optional) One of "blob", "bloburl", "dataurlstring". Do not specify this parameter if you want to get raw PDF content as a string value.

Implemented in:
SurveyPDF
save method

An asynchronous method that starts download of the generated PDF file in the web browser.

Type:
(fileName?: string) => any
Parameters:
fileName, type: string ,

(Optional) A file name with the ".pdf" extension. Default value: "survey_result.pdf".

Implemented in:
SurveyPDF

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

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

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.