print

The Print action allows the current form to be opened in a print view. The form can then be saved as a pdf. If the header and footer are not desired in the print view, they can be shown and hidden in "More settings" or "Other settings" directly next to the print view in the pop-up window. The print view differs from the normal view as background graphics are switched off by default. These can be shown again under the field for the header and footer. To change the print view in general, you can use the Css command:

@media print {}

Regeln definiert werden, die nur für den Druck benutzt werden. Diese Regeln können den anderen benutzerdefinierten Regeln einfach angefügt werden. So können unter anderem für den Druck nicht relevante Buttons ausgeblendet werden.

Overview

action ("print")

Action to be executed. No payload must be specified for this action.

Examples

Print a form

Example print.json
print.json
{
  "$schema": "https://forms.virtimo.net/5.1.0/schema.json",
  "metaData": {
    "id": 0,
    "version": 0
  },
  "configuration": {
  },
  "components": [
    {
      "type": "container",
      "label": "Print",
      "components": [
        {
          "type": "button",
          "action": "print",
          "label": "Print Button"
        },
        {
          "type": "textfield",
          "value": "1"
        }
      ]
    }
  ]
}

Print with customized style

In the following example, the style is customized for the print. The title is green when printing and the print button is hidden.

Example printWithChangedStyle.json
printWithChangedStyle.json
{
  "$schema": "https://forms.virtimo.net/5.1.0/schema.json",
  "metaData": {
    "id": 0,
    "version": 0
  },
  "configuration": {
    "styles": {
      "css": "@media print {.x-button {display: none} .x-paneltitle {color: green}}"
    }
  },
  "components": [
    {
      "type": "container",
      "label": "Print",
      "components": [
        {
          "type": "button",
          "action": "print",
          "label": "Print Button"
        },
        {
          "label" : "First Textfield",
          "type": "textfield",
          "value": "1"
        },
        {
          "label" : "Second Textfield",
          "type": "textfield",
          "value": "Hello"
        }
      ]
    }
  ]
}

Keywords: