# PDFCREATE

#### Syntax <a href="#syntax.15" id="syntax.15"></a>

**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 - ***Value type**: text (optional, default value: current page name)*

  Possible value types:

  * *text* - the name of the page which should be downloaded as pdf file
  * *json - see below under "Remarks"*

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](/nedyx/working-with-nedyx/file-management.md) chapter.

#### Remarks <a href="#examples.1" id="examples.1"></a>

* 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 actionType “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 text, it specifies the new selected 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.

#### Examples <a href="#examples.1" id="examples.1"></a>

**Example 1**

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.

<div align="left"><figure><img src="/files/gMUpg4NyH2LGcLSD1s4T" alt=""><figcaption></figcaption></figure></div>

**Example 2**

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 the SENDEMAIL function and deleted using the DELETEFILE function.

<div align="left"><figure><img src="/files/IiHJPBzxaLOzjQFfUqxM" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nedyx.com/nedyx/clearlines-functions/import-export-functions/pdfcreate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
