QRdx

Downloads

Export QR codes as PNG, JPG, SVG, PDF or vector EPS, copy them to the clipboard or get a data URL.

Export QR codes as PNG, JPG, SVG, or PDF.

Quick Download

import { downloadQRCode, PRESET_SIZES } from 'qrdx';

await downloadQRCode(
  {
    value: "https://example.com",
    size: 1024,
    fgColor: "#000000",
    bgColor: "#ffffff",
  },
  {
    format: "png",
    size: PRESET_SIZES.large,
    filename: "my-qrcode.png"
  }
);

Supported Formats

PNG

Best for web, supports transparency.

await downloadQRCode(
  { value: "https://example.com", size: 512 },
  {
    format: "png",
    size: { width: 512, height: 512 },
    filename: "qrcode.png"
  }
);

JPG

Smaller files, solid backgrounds only.

await downloadQRCode(
  { value: "https://example.com", size: 512 },
  { format: "jpg", size: { width: 512, height: 512 }, filename: "qrcode.jpg" }
);

SVG

Perfect for print, infinitely scalable.

await downloadQRCode(
  { value: "https://example.com", size: 512 },
  { format: "svg", size: { width: 512, height: 512 }, filename: "qrcode.svg" }
);

PDF

Ideal for professional documents. PDF export needs the optional jspdf package (npm i jspdf); without it, PDF downloads throw a clear error.

await downloadQRCode(
  { value: "https://example.com", size: 1024 },
  { format: "pdf", size: { width: 1024, height: 1024 }, filename: "qrcode.pdf" }
);

EPS

Vector PostScript for print shops and design tools (Illustrator, CorelDRAW, InDesign). No extra package is needed. Here size.width is in points (72 per inch), so this file is 512 pt wide:

await downloadQRCode(
  { value: "https://example.com", size: 512 },
  { format: "eps", size: { width: 512, height: 512 }, filename: "qrcode.eps" }
);

For an exact physical size, use getQRAsEPS. It returns the EPS as a string: the code is sizeMm wide (default 50 mm), and a frame adds to that.

import { getQRAsEPS } from "qrdx";

const eps = await getQRAsEPS(
  { value: "https://example.com" },
  { sizeMm: 40, bleedMm: 3, colorMode: "cmyk" }
);

EPS has no transparency and no crop marks. Linear and radial gradients print as smooth PostScript Level 3 shadings. PNG and JPEG logos are embedded.

Preset Sizes

import { PRESET_SIZES } from 'qrdx';

PRESET_SIZES.small    // 200x200
PRESET_SIZES.medium   // 400x400
PRESET_SIZES.large    // 800x800
PRESET_SIZES.xlarge   // 1200x1200
PRESET_SIZES["2xl"]   // 1600x1600
PRESET_SIZES["3xl"]   // 2000x2000

Size Recommendations

  • Small (200px) — Social media thumbnails
  • Medium (400px) — Standard web use
  • Large (800px) — High-quality web
  • X-Large (1200px) — Print materials
  • 2X-Large (1600px) — Large format printing
  • 3X-Large (2000px) — Maximum quality

Advanced Options

Get Data URL

import { getQRCodeDataUrl } from 'qrdx';

const dataUrl = await getQRCodeDataUrl(
  { value: "https://example.com", size: 512 },
  "png",
  { width: 512, height: 512 }
);

Copy to Clipboard

import { copyQRCodeToClipboard } from 'qrdx';

await copyQRCodeToClipboard(
  { value: "https://example.com" },
  { width: 512, height: 512 }
);

Get SVG String

import { getSVGString } from 'qrdx';

const svgString = await getSVGString({
  value: "https://example.com",
  size: 512
});

Batch Downloads

Download multiple QR codes:

const qrCodes = [
  {
    props: { value: "https://example.com", size: 512 },
    options: { format: "png", size: { width: 512, height: 512 }, filename: "site.png" }
  },
  {
    props: { value: "tel:+1234567890", size: 512 },
    options: { format: "svg", size: { width: 512, height: 512 }, filename: "phone.svg" }
  }
];

for (const qr of qrCodes) {
  await downloadQRCode(qr.props, qr.options);
}

Error Handling

try {
  await downloadQRCode(
    { value: "https://example.com", size: 512 },
    { format: "png", size: { width: 512, height: 512 }, filename: "qr.png" }
  );
} catch (error) {
  console.error("Download failed:", error);
}

Format Selection

  • PNG — Best quality, larger files, transparency
  • JPG — Smaller files, no transparency
  • SVG — Scalable, small files, web/print
  • PDF — Professional documents, larger files
  • EPS — Vector print files for print shops and design tools

Size Optimization

  • Web use — 256-512px, PNG
  • Print — 1024px+, PDF or PNG
  • Mobile — 256px, optimized
  • Email — 200-300px, balance

Next Steps

Last updated on

On this page