Pdf API (obsolete)
Codeunit 5523590 bdev.Pdf API was the single entry point of the app before version 20.5. It has been split into one codeunit per capability and is obsolete since then.
Code
Do not write new code against this codeunit
ObsoleteState = Pending means the codeunit still compiles, with a warning. It will be removed in a future major version. New code belongs on the codeunits listed below.
What to use instead
bdev.Pdf API method | Replacement |
|---|---|
ApplyStationeryToDocument (all five overloads) | bdev.Pdf - Stationery, same signatures |
ConcatenateDocument(Codeunit, Codeunit) | bdev.Pdf - Concatenate, same signature |
ConcatenateDocument(List of [Text]) | bdev.Pdf - Concatenate, same signature |
SignDocument | No replacement yet - see below |
CreateZUGFeRDInvoice, CreateZUGFeRDInvoiceXml | No replacement yet - see below |
The stationery and concatenate methods forward to the same implementation as their replacements, so moving a call over is a change of the variable declaration and nothing else.
The methods without a replacement
The obsolete reason names a Pdf - Sign codeunit, but it does not exist yet. Until it does, bdev.Pdf API remains the only way to reach the following from AL.
SignDocument
Signs a PDF document digitally with a certificate of your own.
Code
| Parameter | Type | Description |
|---|---|---|
document | Codeunit "Temp Blob" | The PDF document. It is replaced by the signed document. |
certificate | Codeunit "Temp Blob" | The certificate file. |
certificatePin | Text | The PIN of the certificate. |
Code
The certificate leaves Business Central
The certificate and its PIN are sent to the PDF service to perform the signature. Signing through a PDF Signing Configuration rather than through this method keeps the certificate in the app, where it is stored as part of the configuration and referenced by the report selection.
CreateZUGFeRDInvoice and CreateZUGFeRDInvoiceXml
Produce the ZUGFeRD / Factur-X representation of a posted sales invoice: the XML alone, or a PDF with the XML embedded.
Code
| Parameter | Type | Description |
|---|---|---|
document | Codeunit "Temp Blob" | The PDF of the invoice. It is replaced by the PDF with the ZUGFeRD XML embedded. |
invoice | Record "Sales Invoice Header" | The posted sales invoice the XML is built from. |
CreateZUGFeRDInvoiceXml returns the XML as a Temp Blob codeunit.
CreateZUGFeRDInvoiceXml builds the XML in Business Central and needs nothing else. CreateZUGFeRDInvoice embeds it into the PDF through the PDF service and needs the separately licensed ZUGFeRD feature of the app; the service call is made with a PDF A/3-U conformance level and version V2_1.
There is no counterpart for credit memos on this codeunit, although the app produces them during report processing.


