Paperbase Docs

Report Template

The built-in report template — cover page, table of contents, running headers, page numbers, and brand theming.

The report template is the only built-in template in Paperbase v1. It produces a professional multi-page document from Markdown or HTML input.

What it renders

  • Cover page — logo, document title extracted from the first # heading, and period/date if present
  • Table of contents — auto-generated from ## and ### headings
  • Running headers — document title and section heading on each page
  • Page numbers — bottom of each page, e.g. "Page 3 of 8"
  • Brand theme — logo, accent color, and fonts from your theme object

Usage

const result = await paperbase.pdf.generate({
  input: { type: "markdown", content: markdownString },
  template: "report",
  theme: {
    logo_url: "https://cdn.example.com/logo.svg",
    accent_color: "#ff4e8c",
    body_font: "Inter",
  },
});

Markdown conventions

The template respects standard Markdown structure:

ElementRendering
# TitleCover page title
## SectionNew section, included in TOC
### SubsectionSubsection, indented in TOC
**Bold**Bold
`code`Inline code, monospace
```…```Code block with syntax highlighting
`Table
> BlockquoteCallout / pull quote style

Theme properties

See API reference → Theme for the full theme schema.

For best results:

  • Provide an SVG logo (renders crisply at 300 DPI)
  • Use a hex color with ≥ 4.5:1 contrast on white backgrounds to avoid PB_COLOR_CONTRAST_LOW
  • Use body_font: "Inter" or "Source Serif Pro" — both are in Paperbase's font cache

Common warnings

CodeWhen it fires
PB_TABLE_HEADER_NOT_REPEATINGA table spans pages but <thead> is missing
PB_THEME_INCOMPLETENo theme was passed
PB_LOGO_LOW_RESOLUTIONLogo source is under the recommended 512px

On this page