Skip to main content

PDF Print

Use the PDF Print trigger when you want a flow to react every time Business Central produces a PDF for a specific report – for example, to stamp a watermark, attach company stationery, archive the file to a network share, or send a copy by email. The flow runs synchronously inside the print pipeline and can either let Business Central keep the original PDF or replace it with a modified version.

Typical examples include:

  • Adding a "DRAFT" watermark to invoices that haven't been signed off.
  • Overlaying company letterhead on every printed sales order.
  • Mirroring a copy of each printed PDF to a SharePoint folder.
  • Logging a record of every printed invoice in an external archive.

What happens when the flow runs

  1. A user prints, saves, downloads, previews or schedules a PDF report from Business Central. The flow fires for any of these intents (the configured report lines are the filter; the action that produced the PDF is exposed as the Intent output so the flow can branch on it).
  2. AutoFlow checks whether the report appears in the flow's report lines and, if its output is a PDF (Excel and Word exports are ignored), starts the flow.
  3. The flow runs to a Return PDF step. If it reaches one, the base64-encoded PDF from that step replaces the original document. If it finishes without one – or errors, or exceeds the configured Timeout – Business Central keeps the original PDF.
  4. Each invocation is logged as a standard AutoFlow execution. The full report payload (ObjectPayload) is recorded so you can audit what was printed; the document bytes themselves are not stored to keep the log compact.

Trigger configuration

  • Reports – one line per report whose PDF outputs should fire this flow. Type the report number (e.g. 1306) and it is completed to "number - name", or pick the report with the assist-edit (…). Reports not in the list never start the flow.
  • Timeout (sec) – how long the flow may run before Business Central falls back to the original PDF. Default 30 s. This is the user-perceived wait time on the print thread, so keep it as short as the flow allows.
One flow for the whole company

Only one published flow can use this trigger. Publishing a second one fails fast – add more report lines to the existing flow instead.

Trigger outputs

The flow body has six outputs to work with:

OutputDescription
ObjectPayloadThe full report payload as JSON text (report id, layout, filter views, intent, run id, ...). Pass through a Parser step if you need a deeper field.
DocumentStreamThe original PDF, base64-encoded. Bind this to the Return PDF step's input if you want to pass the document through unchanged, or feed it to an HTTP Request step that transforms it.
ReportIdThe report's object id (e.g. 1306).
DocumentTypeThe MIME type of the document. Currently always application/pdf for triggered runs.
LayoutNameThe selected report layout's name.
IntentWhat the user did – one of Print, Preview, Save, Download, Schedule. Useful if you only want to act on actual prints.

Example flow

A watermarking flow for the Standard Sales Invoice report:

  1. When a PDF is printed – Reports: 1306 (Standard Sales - Invoice).
  2. HTTP RequestPOST {{TriggerOutputs.DocumentStream}} to your watermarking service. The response is the watermarked PDF, base64-encoded.
  3. Return PDF – Document = {{HttpResponse.body}}.

When a user prints the invoice, the printed PDF carries the watermark. If the watermarking service is slow, hits an error, or doesn't respond within Timeout, the original invoice prints unchanged – the user never sees a failure.

When the flow doesn't fire

  • The report's output isn't a PDF (Excel, Word, or other formats).
  • A different subscriber already produced a modified PDF and set Success = true. AutoFlow respects that and exits.
  • The report that was just printed is not on the flow's report lines.