# Page Header

Repeating page header.

> For the complete documentation index, see [llms.txt](/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](/.well-known/agent-skills/site-skill.md).

## Installation

```bash
npx shadcn@latest add @angular-pdfcn/takumi/page-header
```

To install manually, add the dependencies:

```bash
npm install takumi-pdf @takumi-rs/helpers
```

Then copy these files into your project and update the import paths to match your setup:

- `components/pdf/page-header/page-header.ts`
- `lib/resolve-color.ts`
- `components/pdf/theme-provider.ts`
- `lib/pdf-renderer.ts`
- `lib/pdf-primitives.ts`
- `lib/render.ts`
- `lib/pdf-themes/professional.ts`
- `lib/pdf-themes/primitives.ts`
- `types/pdf-themes.ts`
- `types/pdf-components.ts`

## Usage

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

import { PdfPageHeader } from "@/components/pdf/page-header/page-header";
import { PdfText } from "@/components/pdf/text/text";
import { PdfcnThemeProvider } from "@/components/pdf/theme-provider";
import {
  TakumiDocument,
  TakumiPage,
  TakumiView,
} from "@/lib/pdf-primitives";

@Component({
  imports: [
    TakumiDocument,
    TakumiPage,
    PdfcnThemeProvider,
    TakumiView,
    PdfPageHeader,
    PdfText,
  ],
  template: `
    <takumi-document>
      <takumi-page [size]="{ height: 240, width: 595 }">
        <pdf-theme-provider>
          <takumi-view>
            <pdf-page-header
              title="Invoice #1042"
              subtitle="Acme Corp"
              rightText="March 2026"
              rightSubText="Due: 2026-03-31"
              variant="simple"
            />
            <pdf-text [style]="textStyle"
              >Prepared for Northwind Industries</pdf-text
            >
            <pdf-text [style]="textStyle"
              >This document demonstrates the simple page header
              variant.</pdf-text
            >
          </takumi-view>
        </pdf-theme-provider>
      </takumi-page>
    </takumi-document>
  `,
})
export class PageHeaderDemo {
  protected readonly textStyle = {
    color: "#555555",
    fontSize: 10,
    lineHeight: 1.6,
    marginBottom: 6,
  };
}
```

## API Reference

### PdfPageHeader

| Input          | Type                                                                                              | Default    |
| -------------- | ------------------------------------------------------------------------------------------------- | ---------- |
| `title`        | `string`                                                                                          | -          |
| `subtitle`     | `string`                                                                                          | -          |
| `rightText`    | `string`                                                                                          | -          |
| `rightSubText` | `string`                                                                                          | -          |
| `variant`      | `'simple' \| 'centered' \| 'minimal' \| 'branded' \| 'logo-left' \| 'logo-right' \| 'two-column'` | `'simple'` |
| `background`   | `string`                                                                                          | -          |
| `titleColor`   | `string`                                                                                          | -          |
| `marginBottom` | `number`                                                                                          | -          |
| `address`      | `string`                                                                                          | -          |
| `phone`        | `string`                                                                                          | -          |
| `email`        | `string`                                                                                          | -          |
| `logo`         | `TemplateRef<unknown>`                                                                            | -          |
| `fixed`        | `boolean`                                                                                         | `false`    |
| `noWrap`       | `boolean`                                                                                         | `true`     |