avraapi.utilities() for the four released Utility operations. Image and
binary-PDF modes return BinaryResponse; Base64 modes return ApiResponse.
Choose the response type before writing application handling code.
Generated output can contain customer or business data. Keep Utility calls
and generated media in your backend. Use
withPrivacyMode() immediately
before an operation, or its existing privacyMode: true input, when the
request needs the one-request AvraAPI privacy guarantee.Generate a QR code
generateQr(params) accepts text, a URL, or a vCard. png and svg return
BinaryResponse; base64 returns ApiResponse<QrBase64Data>.
SDK function
Copy the SDK call
Save a styled PNG QR code
PNG or SVG response
Forpng the body is a Buffer with image/png; for svg it is a Buffer with
image/svg+xml. Use getBuffer(), saveAs(), contentType, size, and the
nullable requestId; do not read media as JSON.
Read a Base64 QR response
Base64 response
logoUrl must be a public HTTP or HTTPS image AvraAPI can fetch. It applies to
PNG and Base64 output; SVG does not include the logo. See Generate a QR code.
Generate a barcode
generateBarcode(params): Promise<BinaryResponse> always returns media; it
has no Base64 mode.
SDK function
Copy the SDK call
Save a barcode image
PNG or SVG response
PNG returnsimage/png; SVG returns image/svg+xml. Use saveAs(), stream
getBuffer() from your own backend, or use toDataUri() only in an approved
server-rendered context. The full barcode type rules are in Generate a barcode.
Generate a PDF from HTML
generatePdf(params) renders HTML to a PDF. responseType: 'binary' (the
default) returns BinaryResponse; responseType: 'base64' returns
ApiResponse<PdfBase64Data>.
SDK function
Copy the SDK call
Save a binary PDF
Binary PDF response
WithresponseType: 'binary', the success body is a Buffer with
application/pdf. It is not JSON.
Read a Base64 PDF response
Base64 response
Generate a PDF from raw HTML with Base64 transport
generatePdfFromBase64(params) is the convenience wrapper for complex HTML.
Pass raw, unencoded HTML; the SDK encodes it and calls generatePdf() with
isBase64: true.
SDK function
Copy the SDK call
responseType, pageSize, orientation,
margins, and privacyMode.
Render complex HTML without manual encoding
Response
The response uses the same binary or Base64 shapes asgeneratePdf(), selected
by responseType. Do not Base64-encode the HTML yourself before using this
convenience method.
