Barcodes and retail

QR code PDF API for documents and labels

Render QR codes inside PDFs for receipts, tickets, labels, onboarding packets, and document lookup workflows using JSON Render or templates.

PRIMARY API JSON Render
ENDPOINT /api/v1/pdf/render
SYSTEMS SaaS backend / ecommerce backend / ticketing backend / document automation service
Job to be done

Place QR codes into PDF documents, labels, receipts, tickets, or forms so users can scan a link, identifier, or lookup token that your system controls.

When to use this API

  • Your system has a URL, token, order ID, ticket ID, or lookup value to encode.
  • You need the QR code drawn into a PDF rather than composited as an external bitmap.
  • You need repeated QR-based layouts through Template Render.
  • You want one API path for text, layout, PDF output, and QR code rendering.

What it does not replace

  • You need URL shortening, access-token issuance, or payment-link creation from gPdf.
  • You need scanner analytics or mobile app logic.
  • You need QR codes outside PDF output.

Which endpoint to call

PRIMARY

/api/v1/pdf/render

JSON Render is the default path for this workflow.

SECONDARY 1

/api/v1/template-render

Use this when the workflow needs the related API path, template contract, or capabilities lookup.

Minimal request

POST /api/v1/pdf/render - document page with QR lookup code.

{
  "pages": [
    {
      "size": "a4",
      "elements": [
        {
          "type": "text",
          "x": 20,
          "y": 24,
          "content": "Scan to view this document online",
          "style": { "font_size": 14, "font_family": "NotoSans-Regular" }
        },
        {
          "type": "barcode",
          "format": "qrcode",
          "content": "https://example.com/documents/DOC-2026-001",
          "x": 20,
          "y": 44,
          "width": 32,
          "height": 32
        }
      ]
    }
  ]
}

What gPdf handles

  • Vector QR barcode rendering inside PDF output.
  • Text, layout, receipt, ticket, label, or document context around the QR code.
  • Template binding for repeated QR workflows.
  • PDF response delivery through the public render APIs.

What your system owns

  • Encoded URL or token, access control, expiry, redirect behavior, and mobile destination.
  • Scanner testing, user journey, and fraud prevention rules.
  • Any payment, ticket, return, or account action triggered after scanning.

Production checklist

  1. Keep encoded URLs stable or redirectable for the document lifetime.
  2. Test scan distance, contrast, size, and print material.
  3. Avoid embedding sensitive raw data directly in the QR payload.
  4. Use request IDs and log the business object tied to each generated PDF.
  5. Move stable QR layouts to Template Render.

Claim boundaries

  • gPdf renders QR codes in PDFs; it does not host or secure the destination.
  • Your system owns token expiry, redirects, permissions, and scanner UX.
  • A QR code is not a payment or ticketing system by itself.

QR code pages still need clear semantics

The QR code is only the visible carrier. The production workflow depends on the destination or token behind it. gPdf draws the QR code into the PDF; your system owns what happens after the scan.

FAQ

Does gPdf generate QR code images?
gPdf renders QR code barcode elements inside PDF output. The public response is a PDF, not a standalone image service.
Can QR codes be used in templates?
Yes. A template can include QR fields, and callers can send the variable payload data.
Who owns the QR destination?
Your system owns URLs, tokens, redirects, permissions, and expiry behavior.
Can a QR code contain sensitive data?
It can encode whatever you send, but production systems should usually encode a lookup token or URL rather than raw sensitive data.