PDFCREATE

Creates a pdf file with a selection of app pages.

Syntax

PDFCREATE(page)

  • page - the name of the page which should be added to the pdf file, or a json text containing a list of pages to be exported.

    Possible value types:

    • text (optional, default value: current page)

    • json

The function returns the name under which the PDF file is stored on the nedyx server. This name can then be used with the DOWNLOADFILE or SENDEMAIL functions to download the file to the local computer or send it by e-mail.

You can find more information about nedyx file management in the File management chapter.

Remarks

  • If page is specified as a json text, it must follow this syntax: [ [β€œ%pageTitle1%”, β€œ%widgetName1%”, β€œ%actiontype1%”, %actiondata1% ], [β€œ%pageTitle2%”, β€œ%widgetName2%”, β€œ%actiontype2%”, %actiondata2% ], [β€œ%pageTitle3%”] ] with

    • %pageTitle% - the technical name of the page which should be added to the pdf file.

    • %widgetName% - the name of the widget (without β€œ#”). The widget must be on the page %pageTitle% (so that is can be executed in the browser page).

    • %actionType% - the type of action which should be executed on the page before it is added to the pdf. Possible values are: β€œclick” and β€œswitch”

    • %actionData% - for action type β€œswitch”, the position or the value of the new setting can be specified. If this parameter is a number, it specifies the new position of the menu, if it is a string, it specifies the new value of the menu..

  • The parameters widgetName, actionType and actionData are optional. If specified, these actions are performed before the page is added to the pdf file.

  • The function returns !ERROR in case that any error occurs (e.g. the maximum allowed file size is exceeded, or fileName is not a valid file name).

Examples

A click on the "PDFExport" button creates a PDF file containing the current page. This is then downloaded to the local computer using the DOWNLOADFILE function and then deleted using the DELETEFILE function.

A click on the "SendEmail" button creates a PDF file that contains the "SalesDashboard" page twice. On the first page, the menu widget with the name "Region" is switched to "USA", on the second page to "Germany". The generated PDF file is then sent as an email attachment by calling up the SENDEMAIL function and deleted using the DELETEFILE function.