How to auto-print Business Central documents
Print a Business Central report PDF via an AL codeunit or a Power Automate HTTP action. No PrintBase BC extension is included.
For Business Central teams printing reports to a local office or warehouse printer
Overview
Business Central reports already render to PDF or Word. Printing them on a printer in the building is the missing hop when BC is hosted and the printer is not. PrintBase does not ship a Business Central extension. An AL codeunit or a flow you own performs an HTTP POST.
Render the report to PDF in AL, or let Power Automate pick up the file, then send content_type pdf to the printer_code for that company or location. The agent runs on a Windows PC that has the printer installed. The API key stays in a BC secret or an Azure key vault your flow reads, not in a page the user can view.
Use the document number as the Idempotency-Key so a posted shipment does not print twice when the subscriber retries.
Integration steps
- 01
Choose AL or a flow
AL can POST directly after the report render. Power Automate can POST if it has the PDF bytes and the secret. Both are your integration, not a connector we publish.
- 02
Install the agent on the printer PC
The PC must stay logged in enough for the agent to hold its WebSocket. Note the printer code.
- 03
Send the PDF
content_type pdf, base64 content, printer_code, Authorization Bearer.
- 04
Key by document number
Posted sales shipment or invoice number plus a document type prefix keeps reprints distinct from retries.
- 05
Log the job id on the record
Write it to a field so warehouse staff can ask support to GET that job.
curl
# Shape an AL HttpClient or a flow would POST for a BC report PDF
curl -X POST 'https://api.printbase.cloud/v1/print-jobs' \
-H "Authorization: Bearer $PRINTBASE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"printer_code": '"$PRINTER_CODE"',
"content_type": "pdf",
"content": "<base64 pdf>",
"copies": 1
}'
Details for this setup
PDF path for a Business Central report
Use content_type pdf and exactly one of content (standard base64) or content_url (an http or https URL the agent can download). A private file must be fetched by your server and sent as base64, or exposed as a short-lived URL. On Windows the agent asks a PDF app to print to the named queue; if none is registered, the failure text names Adobe Reader or SumatraPDF as examples. macOS and Linux use lp.
Cloud BC does not see your LAN
That is why the agent is outbound. Do not port-forward the printer. Do not put the printer's private IP in the BC request.
Questions
Is there a Microsoft AppSource app?
No PrintBase AppSource app is part of this product. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Can Power Automate call the API?
Yes, with an HTTP action, if the flow can read the API key from a secret store. There is no dedicated connector listed in this product.
Word layouts?
Convert to PDF first. The API accepts pdf or raw, not docx. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Several companies in one tenant?
Use printer_code values per company, or separate PrintBase organizations and API keys if the printers must be isolated.
Free plan: 100 jobs a month on one computer, no card.