For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any docs URL. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0Sponsor

QR Code

QR code generated from a string value.

Takumi Forme
Rendering PDF…

Installation

$ pnpm dlx shadcn@latest add @angular-pdfcn/forme/qrcode

Usage

import { Component } from "@angular/core";

import { PdfHeading } from "@/components/pdf/heading/heading";
import { PdfQRCode } from "@/components/pdf/qrcode/qrcode";
import { PdfSection } from "@/components/pdf/section/section";
import { PdfStack } from "@/components/pdf/stack/stack";
import { PdfText } from "@/components/pdf/text/text";
import {
  FormeDocument,
  FormePage,
} from "@/lib/pdf-primitives";

@Component({
  imports: [
    FormeDocument,
    FormePage,
    PdfHeading,
    PdfQRCode,
    PdfSection,
    PdfStack,
    PdfText,
  ],
  template: `
    <forme-document>
      <forme-page size="A4" [margin]="40">
        <pdf-section spacing="none">
          <pdf-heading [level]="1">Invoice #12345</pdf-heading>
          <pdf-text>Amount Due: $500.00</pdf-text>
          <pdf-section>
            <pdf-stack direction="horizontal" gap="lg" align="start">
              <pdf-qrcode
                value="https://pdfcn.dev/pay/invoice-12345"
                [size]="100"
                caption="Scan to pay"
              />
              <pdf-qrcode
                value="https://pdfcn.dev/verify/invoice-12345"
                [size]="80"
                caption="Verify document"
              />
            </pdf-stack>
          </pdf-section>
          <pdf-text variant="sm" color="mutedForeground"
            >QR codes are rendered as crisp vector graphics in the generated
            PDF.</pdf-text
          >
        </pdf-section>
      </forme-page>
    </forme-document>
  `,
})
export class QRCodeDemo {}

API Reference

PdfQRCode

Input Type Default
value string -
size number -
color string -
backgroundColor string -
errorLevel 'L' | 'M' | 'Q' | 'H' -
margin number -
caption string -