Skip to content

Forms · PDF generator

From a form to a signed PDF.

Lay out a PDF in the designer and fill it with a form's answers. When the visitor presses the button, the PDF generator makes the file and hands it on: as a download, or to Signet to be signed.

dotnet add package Veva.Modules.Puppeteer

What you need

Three packages, one flow.

The PDF generator comes with Essentials. Puppeteer turns its layout into a PDF, and Signet Signature sends that PDF to be signed.

PDF generator

Veva.Web.Essentials

A Forms component in Veva.Modules.FormComponents: an A4 layout of the form's answers, and the file handlers that get the PDF.

Built in
dotnet add package Veva.Web.Essentials

Puppeteer

Veva.Modules.Puppeteer

Renders the layout as an A4 PDF in headless Chromium, with each website's margins, header and footer.

Add-on
dotnet add package Veva.Modules.Puppeteer

Signet Signature

SignetSignature.VevaComponents

Sends the PDF to Signet Signature, with a field for each signer and components to sign and follow the documents.

Signing
dotnet add package SignetSignature.VevaComponents

What it does

Designed like a page, made on submit.

Designed like a page

The PDF generator has an area of its own, shown as an A4 page in the designer. Place headings, text, tables and images in it.

The answers, bound in

Write {Name} in the layout or in the file name, and the PDF shows what the visitor typed in the Name field.

One button

A Form Action button set to GeneratePDF makes the PDF, hands it to the file handlers, then submits the form.

Handlers decide where it goes

Trigger download is built in. Pick more than one, and each gets the same file: a download, Signet, or a handler of your own.

Margins, header and footer

Puppeteer renders A4. Each website sets its margins, a header image from the library and a footer with page numbers.

Check it first

In the designer, Download PDF makes a test file. Show preview puts the A4 layout in front of visitors too.

How it works

From the button to the file.

  1. 01

    Fill in the form

    A Document Form or a Generic Form, with the PDF generator inside it.

    PDF generator
  2. 02

    Press the button

    A Form Action button runs the form's GeneratePDF action.

    GeneratePDF
  3. 03

    Render

    The layout and the page's styles become an A4 PDF in headless Chromium.

    IHtmlToPdfService
  4. 04

    Hand it on

    Each file handler the editor picked gets the file.

    IPDFFileHandler
  5. 05

    Submit

    Then the form submits as usual, so a Document Form still saves its document.

Signing

Signed through Signet.

The Signet Signature package adds a file handler and components. Set the Signet environment and your credentials in the settings, then test them from the site.

In the form

Signers

Add a Signet Signer field for each person who signs. A signer can be required or optional, and can be allowed to reject the document.

Then pick Send to SignetSignature in the PDF generator's file handlers. It sends the generated PDF to Signet Signature to be signed.

On the site

Follow

Components for the documents once they are sent:

  • Sign Document View: shows a document and signs it
  • Document List: lists the documents, with filters
  • Document Events and Document Logs: what happened to each one
  • Test Signet Signature settings: checks your credentials against the service

For developers

Send the PDF anywhere.

A file handler gets the PDF's name and bytes, and a context whose RenderContext holds the form's values in its data binding. Register it in your module, and editors pick it in the PDF generator's File handlers.

Extension points

API

Extend the PDF generator from a module:

  • IPDFFileHandler: gets each generated PDF, in Veva.Modules.FormComponents
  • IHtmlToPdfService: turns HTML into a PDF; Veva.Modules.Puppeteer is one
SaveToServerHandler.cs
[DisplayName("Save to the server")]
[Description("Keeps a copy of each generated PDF in the site's pdf folder")]
public class SaveToServerHandler(IWebHostEnvironment env) : IPDFFileHandler
{
    public async Task HandleFile(
        string filename, byte[] fileData, FileHandlerContext context)
    {
        string folder = Path.Combine(env.ContentRootPath, "pdf");
        Directory.CreateDirectory(folder);
        string path = Path.Combine(folder, Path.GetFileName(filename));
        await File.WriteAllBytesAsync(path, fileData);
    }
}

// services.AddNamed<IPDFFileHandler, SaveToServerHandler>();

More of Veva

Explore the other features.

Each one is made of modules. Reference a package, restart, and its components are in the editor.

All features

Page builder

Compose pages from components, then preview and publish

Open

Components and data

Components that show, components that fetch, and the binding between them

Open

Documents

Structured content you list, filter and serve anywhere

Open

Forms

Document forms that save, generic forms that filter or post

Open

Assets

One media library, with images sized on request

Open

Search

Crawl, index and search the whole site

Open

AI and agents

The admin's AI assistant, and the MCP server coding agents connect to

Open

Veva core

BuildVeva(), modules, components, themes and hooks

Open

Tech stack

Plain .NET Blazor: three render modes, standard components

Open

Integrations

Data sources, sign-in, mail, analytics and media

Open

Module library

Every module: what comes with Essentials, and the add-ons

Open

Type to search the docs, components and API.

↑↓ to move ↵ to open Esc to close Search by Veva