PDF Snapshot Action

The PDF Snapshot form action creates a PDF of each submission, laid out like the completed form. The PDF is stored with the submission and can be attached to a GlobalCapture process by the GlobalCapture Workflow action.

Server-stored credentials and the Preview PDF button require GlobalForms version 10.18 or greater.

How it works

When a form is submitted, GlobalForms opens the completed submission in a built-in browser, signed in as a GlobalForms account you choose, and saves it as a PDF. That account must be able to view the form's submissions.

Before you begin

  • Create or choose a GlobalForms user account for generating PDFs. Give it read access to submissions on the forms that use this action, and nothing more.

  • Decide where to keep that account's credentials. Storing them on the server (recommended) keeps the password out of form definitions and form exports.

Step 1 (recommended): Store the PDF credentials on the server

  1. Add the account to config\local.json:

    JSON
    {
      "settings": {
        "pdfGen": {
          "credentials": {
            "username": "<PDF account user name>",
            "password": "<Password>"
          }
        }
      }
    }
    
  2. Restart the GlobalForms service.

Step 2: Add the action to a form

  1. Open the form in the form builder and select the Actions tab.

  2. Add the PDF Snapshot action.

  3. Complete the settings below.

  4. Select Preview PDF to check the layout (see below), then save the action.

Setting

Description

Use server stored credentials

Turn on to use the account from local.json. Leave Authorize User and Authorize Password blank.

Authorize User, Authorize Password

Only when not using server-stored credentials: the account used to generate PDFs for this form

Wait for PDF to be generated

When on, the submission finishes only after the PDF is ready. Turn this on when a later action, such as GlobalCapture Workflow, needs the PDF.

Scale

Size of the content on the page, from 0.1 to 2. Default 1.0.

Page Size

Paper size, such as Letter, Legal or A4. Default Letter.

Language

The language used to show the form in the PDF

Preview the PDF

Select Preview PDF in the action settings to open a sample PDF in a new tab, using the form's most recent submission and your current Scale and Page Size. Adjust the settings and preview again until the layout looks right.

  • The form needs at least one submission before you can preview.

  • Previews do not change any submission's saved PDF. Preview files are removed automatically when the service restarts.

Move existing actions to server-stored credentials

Older PDF Snapshot actions store a user name and password in the form. To remove them:

  1. Add the credentials to local.json as in Step 1, and restart the service.

  2. Open each form's PDF Snapshot action.

  3. Turn on Use server stored credentials, clear Authorize User and Authorize Password, and save.

Control page layout

To control where pages break, or hide parts of a form in the PDF, use custom CSS. See Controlling Page Breaks in Snapshots and Don't Print / Only Print.

Troubleshooting

Symptom

Cause and fix

An error says server credentials are missing

Use server stored credentials is on, but settings.pdfGen.credentials is missing from local.json. Add it and restart the service.

An error says action credentials are missing

Server-stored credentials are off and the action has no user name or password. Turn on server-stored credentials, or fill in both fields.

The PDF shows a sign-in page or an access message instead of the form

The PDF account cannot view the submission. Check its password and give it read access to the form's submissions.

Preview PDF does nothing or fails

The form has no submissions yet, or Scale or Page Size is empty. Submit a test entry and try again.

Content is cut off or too small

Adjust Scale and Page Size, and use page-break CSS for long forms.

The GlobalCapture process has no PDF

Turn on Wait for PDF to be generated, and make sure the PDF Snapshot action is above the GlobalCapture Workflow action.