Skip to content

Business Central

Business Central online can’t reach printers in your network by itself. With the Printsluis extension, your Printsluis printers appear in Business Central’s Printer Management and printer selections. Reports you print on them, such as a sales invoice or a shipment, go as a PDF through Printsluis to the agent in your network, which prints them. Label and shipping apps can print ZPL labels on your Zebra printers through the extension too (Labels from other extensions).

You need:

  • Business Central online, version 26 (2025 release wave 1) or later;
  • a Printsluis organization with an agent and a printer of the type Office printer (PDF), on a plan that includes PDF printing, for reports; or a Zebra label printer (ZPL) or Generic printer (raw) for labels from other extensions;
  • permission to install extensions, and the Printsluis - Admin permission set to set it up. Every user with D365 BASIC can print.
  1. Install the extension. In Business Central, search for Extension Marketplace, find Printsluis and choose Get it now.

  2. Create an API key. In the Printsluis portal, open API keys and choose Create API key. Name it after the Business Central environment, and keep the scopes print:create and printers:read. Copy the key: it is shown only once.

  3. Connect. In Business Central, search for Printsluis Setup and paste the key in API Key. Business Central checks the key, shows your organization’s name, enables Printsluis and copies your PDF printers and their aliases. The key is stored encrypted, per company.

  4. Choose the printers. Open Printer Selections and choose a Printsluis printer for a report, such as report 1306 Standard Sales - Invoice, for a user or for everyone. Or open Printer Management, choose the printer and Set as my default printer.

  5. Print. Print a posted sales invoice: it comes out of the printer in your network.

On Printsluis Printers, Print Test Page prints a Printsluis test page without Business Central’s layouts, to check the printer and the agent.

Refresh Printers copies the printers that print PDF, ZPL or raw data, and the aliases that point to one of them. The columns Prints PDF, Prints ZPL and Prints Raw Data show what each prints. Only printers that print PDF appear in Printer Management and the printer selections, because Business Central prints reports as PDF; ZPL and raw printers are for labels from other extensions. Refresh after you add or rename a printer or alias in Printsluis, or change its printer type. A printer keeps its Business Central name when you rename it in Printsluis, because printer selections store that name. A printer or alias that is removed from Printsluis is removed from Business Central too.

Choose an alias, such as invoices (alias), instead of a printer when the printer behind it may change: you change the alias in Printsluis, and Business Central keeps printing to it. A printer can also have a Fallback Alias that prints the report when the printer is disabled or removed in Printsluis.

Two-Sided Printing and Color on the printer card apply to every report printed on that printer; left at Printer default, the printer driver decides.

Business Central knows paper trays by kinds such as Upper and Lower; printer drivers by names such as Tray 2. The printer card’s Trays map them: the first tray is the default, and each tray has the driver’s tray and paper to print on. Printsluis fills them in from what the driver reports, the first time it sees the printer; Reset Trays does it again. A report layout’s paper tray setting then picks the tray.

Business Central prints reports as PDF, so labels in ZPL, such as shipping and product labels for a Zebra printer, come from other extensions: a label or shipping app. Such an app can print through the Printsluis extension with its codeunit PSL Label Print, on a printer or alias from Printsluis Printers. It needs no API key or setup of its own, and the job shows Business Central as its source in the portal.

For users: choose the Printsluis printer or alias in the label app’s setup, as its documentation describes.

For developers of such an app: add the Printsluis extension as a dependency in app.json (ID 7981cb4f-64b7-426f-ac04-0638ae3dee95, publisher Isatis Projects B.V.), and call it:

ShippingLabel.Codeunit.al
using IsatisProjects.Printsluis;
codeunit 50200 "My Shipping Label"
{
procedure PrintLabel(ShipmentNo: Code[20]; PrinterName: Text)
var
LabelPrint: Codeunit "PSL Label Print";
Zpl: Text;
JobId: Guid;
begin
Zpl := '^XA^FO50,50^A0N,40,40^FD' + ShipmentNo + '^FS^XZ';
if not LabelPrint.PrintZpl(PrinterName, Zpl, 'shipment-' + ShipmentNo + '-label', 1, ShipmentNo, JobId) then
Error(LabelPrint.GetLastErrorMessage());
end;
}
Procedure What it does
PrintZpl(PrinterName, Zpl, IdempotencyKey, Copies, ExternalReference, var JobId) Prints ZPL, as Text (UTF-8) or an InStream (byte for byte). Returns true with the job’s ID when Printsluis accepted it.
PrintRaw(PrinterName, Data, IdempotencyKey, Copies, ExternalReference, var JobId) Prints raw printer data the same way. An admin must allow raw printer data in Printsluis’s settings.
GetLastError() Why the last print failed, as Enum "PSL Print Error"; None after a success.
GetLastErrorMessage(), GetLastErrorCode() A message for the user, and the API’s error code, such as printer_unavailable.
LookupZplPrinter(var PrinterName), LookupRawPrinter(var PrinterName) Lets the user choose a printer or alias for your setup page.
  • PrinterName is the name in Printsluis Printers, such as Zebra warehouse or labels (alias).
  • IdempotencyKey is required, 1 to 128 characters. Derive it from what you print, such as shipment-S-SHP1001-label, and use the same key when you retry: the label then prints once (Idempotency).
  • Copies is 1 to 100. ExternalReference, at most 128 characters or empty, shows with the job in the portal. The calling app’s name goes in the job’s metadata as businessCentralApp.
  • A failed print doesn’t raise an error; GetLastError tells why: NotSetUp, PrinterNotFound, FormatNotSupported (the printer doesn’t print the format, as of the last refresh), InvalidRequest, RequestsBlocked, Unavailable (Printsluis couldn’t be reached or was busy; try again with the same key), InvalidApiKey or Refused (see GetLastErrorCode). Values may be added later; treat unknown ones like Refused.

These procedures and the error values are kept stable across versions of the extension.

A sandbox copied from production turns Printsluis off, so it doesn’t print test documents on production’s printers. Turn it on again on Printsluis Setup if the sandbox should print, preferably with a key of a separate Printsluis organization.

Business Central blocks outbound requests from extensions in sandboxes by default. If Printsluis says so, open Extension Management, choose Printsluis, choose Configure and turn on Allow HttpClient Requests.

For each printed report, the extension sends Printsluis the report’s PDF, the report’s ID (such as 1306) and the printer, tray and paper. For a label from another extension, it sends the label, the printer, the number of copies, the reference and the name of the extension that printed it. Printsluis stores the document encrypted and deletes it as soon as the job is final, as for every job (Concepts). The extension cannot encrypt documents end to end: Business Central offers no encryption for that.

The extension’s telemetry to us contains event IDs, report IDs, document formats, the IDs of extensions that print labels, HTTP status codes and error codes, never documents, names or keys.

Message What to do
Printsluis did not accept the API key The key was revoked or mistyped. Create a new key and paste it on Printsluis Setup.
Business Central does not allow the Printsluis extension to make outbound requests Turn on Allow HttpClient Requests for the extension (see Sandboxes).
Printsluis refused the request: … (plan_limit) Your plan doesn’t include PDF printing, or the month’s prints are used up.
Printsluis refused the request: … (printer_unavailable) The printer is disabled or doesn’t print the document’s format. Refresh the printers, or set a fallback alias.
… does not print ZPL The label app uses a printer that doesn’t print ZPL. Choose a Zebra printer or its alias in the label app, or refresh the printers if its type changed in Printsluis.
Printsluis refused the request: … (unknown_tray, unknown_paper) The driver has no tray or paper by that name. Choose Reset Trays on the printer card.
Nothing comes out Check the job, the printer and its agent in the portal.

For the other codes, see Errors.