# @swift-rust/pdf

> PDF component tree and viewer for swift-rust.

Latest version **0.2.2** (published 2026-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @swift-rust/pdf
pnpm add @swift-rust/pdf
yarn add @swift-rust/pdf
bun add @swift-rust/pdf
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2026-10-17 |
| First published | 2026-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cole5689 |

## Links

- npm: https://www.npmjs.com/package/@swift-rust/pdf
- Repository: https://github.com/colesites/swift-rust
- Homepage: https://swift-rust.dev
- Issues: https://github.com/colesites/swift-rust/issues
- npm.io page: https://npm.io/package/@swift-rust/pdf

## Recent versions

- 0.2.2 (latest) — 2026-10-17
- 0.2.1 — 2026-06-04
- 0.2.0 — 2026-06-03

## README

# @swift-rust/pdf

A JSX tree for declaring server-side PDF documents. Compiles down to `printpdf` calls in the Rust bundler.

## Usage

```tsx
import { Document, Page, Text, View } from "swift-rust/pdf";

export default function Invoice({ items }: { items: { id: string; name: string; price: number }[] }) {
  return (
    <Document title="Invoice" author="Acme">
      <Page size="A4">
        <View x={50} y={50}>
          <Text fontSize={18}>Invoice</Text>
          {items.map((it) => (
            <Text key={it.id} y={0}>{it.name}: ${it.price}</Text>
          ))}
        </View>
      </Page>
    </Document>
  );
}
```

---
_Source: https://npm.io/package/@swift-rust/pdf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
