> ## Documentation Index
> Fetch the complete documentation index at: https://docs.teriyakigaming.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Page Documents

> The Ink Page Document asset: page geometry, paper and ink, two-sided sheets, default text style, and the page-per-layer-stack model everything else reads.

An **Ink Page Document** (`UInkPageDocument`) is the asset that holds everything you author:
the pages, the layers on them (front and back), the paper look, and the default text style.
It is a Data Asset — no world, no components — so one document can be shown by any number of
[displays](/plugins/inkwell/components/page-display), [stacks](/plugins/inkwell/components/page-stack),
[widgets](/plugins/inkwell/components/page-widget), and [actors](/plugins/inkwell/components/page-actor) at once, and
editing it updates all of them.

At runtime each page's layers are baked into an ink render target which the page material
multiplies over the paper, so the content reads as ink or print rather than a decal. See
[Rendering](/plugins/inkwell/reference/rendering) for that pipeline.

<Frame caption="The Page Editor's left panel is the whole document asset: Pages, Page Setup, Paper & Ink, Custom Mesh, Default Text Style.">
  <img src="https://mintcdn.com/teriyaki-gaming/rfYUFiwAdsWmGZKv/images/inkwell/page-editor-left-panel.png?fit=max&auto=format&n=rfYUFiwAdsWmGZKv&q=85&s=23171109634b49a52e265415cf587d21" alt="The Page Editor left panel showing the Pages list and Page Setup section" width="384" height="324" data-path="images/inkwell/page-editor-left-panel.png" />
</Frame>

## Creating a document

<Steps>
  <Step title="From the level editor toolbar">
    Click the **Page Editor** button on the level editor toolbar and choose
    **Create New Page Document...**. You pick a name and folder, and the new asset opens
    straight into the [Page Editor](/plugins/inkwell/authoring/page-editor).

    <Frame caption="Inkwell's Page Editor button (1), at the right end of the Level Editor toolbar.">
      <img src="https://mintcdn.com/teriyaki-gaming/rfYUFiwAdsWmGZKv/images/inkwell/toolbar-icon.png?fit=max&auto=format&n=rfYUFiwAdsWmGZKv&q=85&s=5d0dc18233acaeffa70e3e93b1b3f06c" alt="The Level Editor toolbar with the Inkwell Page Editor dropdown button highlighted" width="764" height="102" data-path="images/inkwell/toolbar-icon.png" />
    </Frame>

    <Frame caption="The menu the button opens. Create New Page Document... is the entry that makes a new one.">
      <img src="https://mintcdn.com/teriyaki-gaming/rfYUFiwAdsWmGZKv/images/inkwell/toolbar-dropdown.png?fit=max&auto=format&n=rfYUFiwAdsWmGZKv&q=85&s=c0828c272105f1d37ef06e601ace956f" alt="The Inkwell menu: Edit Document, Recent / All Documents, Create New Page Document, Import Font Family, Documentation" width="231" height="217" data-path="images/inkwell/toolbar-dropdown.png" />
    </Frame>
  </Step>

  <Step title="Or from the Tools menu">
    **Tools → Inkwell** carries the same menu, for projects that hide the toolbar button
    (**Show Toolbar Button** in [Project Settings → Plugins → Inkwell](/plugins/inkwell/reference/settings)).
  </Step>

  <Step title="Or from the Content Browser">
    **Add** (or right-click in the folder) **→ Inkwell → Page Document**, like any other
    asset type. Double-click the result to open it.
  </Step>
</Steps>

A new document is seeded from project settings so it renders something immediately: the
**New Document Page Size Pixels** setting becomes its Page Size Pixels, the
**Default Paper Texture** becomes its Paper Texture, and the **Default Page Font** becomes
its Default Font with Default Typeface set to `Regular`. It always starts with exactly one
page, and that page always has a Text layer to write in.

<Tip>
  Author documents in the [Page Editor](/plugins/inkwell/authoring/page-editor). The text is stored as
  machine-generated markup and is not meant to be typed into a details panel by hand.
</Tip>

## A page is a stack of layers

A page (`FInkPageSpec`) is not a block of text with pictures bolted on. It is an ordered
**back-to-front stack of layers** (`FInkPageLayer`): index 0 is the back of the page, the
last entry is the front. A layer is one of three types — **Text**, **Image**, or
**Drawing** — and carries a `Name`, `bVisible`, `bLocked` and `Opacity` of its own.

Text is a layer payload, so one page can hold a heading, a body and a signature as three
independent text boxes, with images or freehand drawings stacked between them. A watermark
is an Image layer *before* the text; a stamp is one *after* it.

[Layers](/plugins/inkwell/authoring/layers) covers the stack in full — the panel, reordering, locking, and
what each payload does.

| Property            | Type                    | Default        | What it does                                                                                                                                                                  |
| ------------------- | ----------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Layers              | Array of Ink Page Layer | one Text layer | Everything drawn on the front of this sheet, back to front. Edit it in the Page Editor's Layers panel rather than by hand.                                                    |
| Back Layers         | Array of Ink Page Layer | empty          | Everything drawn on the **back** of this sheet, same rules. Empty means the back was never authored: the sheet shows bare paper there and costs no bake and no render target. |
| Paper Override      | Texture 2D              | None           | Paper for this page's front only. Set, it beats both the document texture and generated paper; cleared, the page falls back to the document's.                                |
| Back Paper Override | Texture 2D              | None           | Paper for this page's back only — the back-side twin of Paper Override.                                                                                                       |

<Note>
  Every page Inkwell creates or loads is guaranteed a Text layer on its **front**, so a
  page's writing always has somewhere to draw. The back deliberately gets no such guarantee —
  an empty back is the free, unauthored state. Documents authored before layers existed are
  converted on load — see [Layers](/plugins/inkwell/authoring/layers).
</Note>

## The back of the sheet

Every page is one face of a physical sheet, and the sheet has two (`EInkPageSide`:
`Front`, `Back`). The back is authored independently: its own layer stack (`BackLayers`),
optionally its own paper. A sheet whose back was never authored renders bare paper there
and pays nothing for the feature — **Has Back** (`HasBack`) is false, no back bake runs,
no render target is allocated. Every document saved before backs existed loads exactly
that way.

Flip the sheet in the Page Editor with the **Front** / **Back** toggle under the Pages
list; at runtime the [Ink Page Reader](/plugins/inkwell/components/reader) turns sheets over with
**Flip Page**, and on a multipage document **Next Page** reads in book order:
front → back → next page.

### Where the back gets its paper

The document-wide choice is **Back Paper** (`FInkPaperFace`), whose Mode is an
`EInkBackPaperMode`:

| Mode            | The back's paper is                                                                                                                                                                                           |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Same As Front   | The front's paper, whatever that resolves to page by page. The default, and free.                                                                                                                             |
| Texture         | Its own texture (the face's `Texture`).                                                                                                                                                                       |
| Procedural      | Its own generated sheet (the face's `Procedural` settings) — so a lined front can carry a plain back.                                                                                                         |
| Custom Material | Its own material entirely (the face's `Material`), carrying `MF_InkwellPageInk`. Slab-only: a flat single-slot mesh has one material for both faces, so its back keeps the front's and this is ignored there. |

When the Mode is anything but Same As Front, the face's `Tint` is multiplied over the
back's paper the way **Paper Tint** is over the front's. On top of all of that, any single
page can set **Back Paper Override** to give just its own back a texture.

## Page Setup

Geometry shared by every page in the document.

| Property               | Type      | Default              | What it does                                                                                                                                                                                                                                                       |
| ---------------------- | --------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Page Size Pixels       | Int Point | (1024, 1400)         | Bake resolution of a page in pixels — **and** the page's shape, because the aspect ratio comes from here. Blueprint-read-only.                                                                                                                                     |
| Page Width Cm          | Float     | 21.0                 | How wide a page is in the world, in centimeters (21.0 is A4 width). Clamped to a minimum of 0.1; the editor spinner runs 1–200. The only physical dimension you set.                                                                                               |
| Margins Px             | Margin    | 90 on all four sides | Text margins, in page pixels. A page-filling text layer wraps inside these. Blueprint-read-only.                                                                                                                                                                   |
| Line Height Percentage | Float     | 1.18                 | Line spacing for the whole document, as a multiple of the font's own line height; clamped 0.5–3. Every text layer follows it until that layer is given a Line Height Percentage of its own — see [Layers](/plugins/inkwell/authoring/layers). Blueprint-read-only. |

### The page-sizing model

This is the part worth reading twice, because it is what stops authored pages from looking
wrong in the world.

A page has exactly **one** shape and **one** physical size, derived from two numbers that
do different jobs:

* **Page Size Pixels** is resolution *and* proportion. `1024 × 1400` is a portrait page;
  `800 × 500` is a landscape one.
* **Page Width Cm** is how big that page is in the level — and it is the **only** physical
  dimension in the whole plugin. There is no height field anywhere.

The height is computed, not authored. **Get Page Size Cm** (`GetPageSizeCm`) returns
`(PageWidthCm, PageWidthCm × PageSizePixels.Y / PageSizePixels.X)`:

| Page Size Pixels | Page Width Cm | Get Page Size Cm                   |
| ---------------- | ------------- | ---------------------------------- |
| 1024 × 1400      | 21.0          | 21.0 × 28.7 cm (portrait, near A4) |
| 800 × 500        | 21.0          | 21.0 × 13.1 cm (landscape)         |
| 1024 × 1024      | 12.0          | 12.0 × 12.0 cm (square)            |

The reason is mechanical: the baked ink texture is mapped across the whole sheet, so a
sheet shaped differently from the page would stretch every letter on it. By deriving the
height there is no second number to get wrong, and **authored text can never come out
stretched**. Author a landscape page and you get landscape paper, automatically, everywhere
the document is shown.

Every Inkwell surface measures its paper from this: the sheet an
[Ink Page Display](/plugins/inkwell/components/page-display) spawns, every sheet in an
[Ink Page Stack](/plugins/inkwell/components/page-stack), and the [Ink Page actor](/plugins/inkwell/components/page-actor).
In the Page Editor, the **Width cm** row shows the derived height beside it as
`x 28.7 cm high`, and committing either row re-sizes every page already placed in the level.

<Tip>
  To make one placed sheet bigger without touching the document, use **Page Scale** on that
  page's [Ink Page Display](/plugins/inkwell/components/page-display) component. It multiplies the document's
  size for that instance only — **Get Effective Page Size Cm** (`GetEffectivePageSizeCm`)
  returns the result. Because it scales both axes together, the no-stretch guarantee survives
  every value.
</Tip>

<Note>
  Bake resolution is safety-clamped by **Max Page Bake Dimension** in
  [Project Settings → Plugins → Inkwell](/plugins/inkwell/reference/settings) (default 4096 per axis). A
  document asking for more is scaled down proportionally rather than allocating an enormous
  render target — the aspect ratio, and so the page shape, is preserved.
</Note>

<h2 id="paper-ink">
  Paper & Ink
</h2>

The sheet itself and the tint of everything written on it.

| Property         | Type                 | Default            | What it does                                                                                                                                                      |
| ---------------- | -------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Paper Mode       | Ink Paper Mode       | Texture            | Where the paper comes from — the four modes below.                                                                                                                |
| Procedural Paper | Ink Procedural Paper | Lined, cream stock | Settings for generated paper — ruling, colors, spacing, margin rule, punched holes, grain. Used only while Paper Mode is Procedural.                              |
| Paper Material   | Material Interface   | None               | The page's whole material, while Paper Mode is Custom Material — your own graph with the `MF_InkwellPageInk` material function dropped in to receive the writing. |
| Paper Texture    | Texture 2D           | None               | Paper albedo. Used only while Paper Mode is Texture; unset, the page material falls back to its plain-paper color.                                                |
| Paper Tint       | Linear Color         | White              | Multiplied over the finished paper, generated or supplied. This is how you age one document without touching the stock.                                           |
| Back Paper       | Ink Paper Face       | Same As Front      | Where the back of every sheet gets its paper — see [The back of the sheet](#the-back-of-the-sheet).                                                               |
| Ink Tint         | Linear Color         | White              | Multiplied over everything the page draws: text, images and brush strokes alike.                                                                                  |
| Ink Strength     | Float                | 1.0                | 1 is fully opaque ink; lower (0–1) lets more paper grain through every stroke.                                                                                    |

### The four paper modes

`EInkPaperMode` decides where the sheet under the ink comes from:

| Mode            | Editor label        | What happens                                                                                                                                                                                                                                                                                                                                         |
| --------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Texture         | Texture asset       | The **Paper Texture** you supply (or the project default when unset).                                                                                                                                                                                                                                                                                |
| Procedural      | Generated           | Inkwell draws the sheet from the **Procedural Paper** settings — plain, lined, grid or dotted stock with no assets at all. [Paper](/plugins/inkwell/authoring/paper) covers every setting.                                                                                                                                                           |
| Custom Material | Custom material     | The document's **Paper Material** *replaces* the target slot: your own graph — wood, vellum, an animated hologram — with the `MF_InkwellPageInk` material function wired in to receive the ink. Every Inkwell runtime control (ink, tints, strengths, face mapping) keeps working, because the function carries the named parameters Inkwell drives. |
| Mesh Material   | Mesh's Own Material | **No paper from Inkwell at all**: the ink is laid onto whatever material the mesh already wears, via a dynamic instance per mesh instance, so per-instance textures and parameter overrides survive. Unlike Custom Material, this mode never replaces anything.                                                                                      |

<Warning>
  In **Mesh's Own Material** mode the target material must contain the `MF_InkwellPageInk`
  material function, with your final color wired through it. A material without the function
  shows no ink and raises no error — that is the contract, not a failure. See
  [Rendering](/plugins/inkwell/reference/rendering) for wiring it up.
</Warning>

### Per-page paper override

Any page can replace the document's paper with its own. **Paper Override** on the page wins
over everything: it beats the document's Paper Texture *and* the generated sheet, so
switching a document to Procedural never silently discards a page that had been given its
own stock. Cleared, the page falls straight back to the document's paper.

**Get Paper For Page** (`GetPaperForPage`) is the one function that resolves all of this.
For the front (and for a back whose mode is Same As Front, which falls through to the
front's chain — per-page override included):

<Steps>
  <Step title="The page's own Paper Override">
    Returned as-is when set.
  </Step>

  <Step title="No texture in the material modes">
    When Paper Mode is Custom Material or Mesh's Own Material the material brings its own
    paper, so there is no texture to hand out — the function returns nothing.
  </Step>

  <Step title="Generated paper">
    When Paper Mode is Procedural, the sheet is rasterized on first use and cached on the
    document, so twenty pages sharing a document share one generated sheet.
  </Step>

  <Step title="The document's Paper Texture">
    Otherwise. If that is unset too, the page material uses its own plain-paper color.
  </Step>
</Steps>

Asked for the back (`Side` = Back), the back's own chain runs first: the page's
**Back Paper Override**, then the document's **Back Paper** mode. A back Procedural sheet
with settings identical to the front's reuses the front's cached paper rather than
rasterizing a second identical texture.

Use overrides for the aged first page of an otherwise clean journal, a bloodstained note in
a sequence of ordinary ones, or a title page on different stock.

## Default Text Style

The style of **unstyled** text — anything typed without applying toolbar styling. Styled
runs carry their own font, size, color and typeface in the markup and ignore these.

| Property          | Type         | Default                   | What it does                                                                                    |
| ----------------- | ------------ | ------------------------- | ----------------------------------------------------------------------------------------------- |
| Default Font      | Font         | None                      | Font for unstyled text (a composite `UFont` asset). Unset = the project's Inkwell default font. |
| Default Typeface  | Name         | None                      | Typeface entry inside the composite font: `Regular`, `Bold`, `Italic`, and so on.               |
| Default Font Size | Float        | 28.0                      | Size of unstyled text, in page pixels at 96 DPI. Clamped 6–400.                                 |
| Default Color     | Linear Color | (0.02, 0.017, 0.025, 1.0) | Slightly warm near-black — it reads as ink better than pure black does.                         |

**Get Effective Default Font** (`GetEffectiveDefaultFont`) resolves a three-step chain: the
document's **Default Font** when set, otherwise the project-wide **Default Page Font**
([Project Settings → Plugins → Inkwell](/plugins/inkwell/reference/settings)), and as a last resort the
engine's own Roboto — so text is never invisible in a project that has configured nothing.
See [Fonts](/plugins/inkwell/authoring/fonts) for the full picture.

## Custom mesh preview

Three editor-only properties under **Preview** let the Page Editor show the document on the
prop that will carry it in game: **Preview Mesh** (unset, the preview uses the plugin's
flat page sheet, sized from the document — exactly what a mesh-less actor gets in game),
**Preview Material Slot**, and **Preview Face Mapping** (`FInkPageFaceMapping`), which maps
the page onto a UV region of that slot with quarter-turn rotation.

These are authoring intent: they travel with the asset but do not survive cooking, and a
document never imposes a mesh on its consumers. At runtime the mesh and the face mapping
belong to the component that displays the page — copy the preview's settings onto the
[Ink Page Display](/plugins/inkwell/components/page-display) component's **Page Face** when the real prop
uses the same mesh. Edit all three in the Page Editor's
[Custom Mesh section](/plugins/inkwell/authoring/page-editor#custom-mesh).

## Pages

| Property        | Type                   | Default        | What it does                                                                                                                              |
| --------------- | ---------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Pages           | Array of Ink Page Spec | one empty page | The document's content. Blueprint-read-only on purpose — mutate it through the functions below.                                           |
| Font References | Array of Object        | empty          | Advanced. Hard references to every font used anywhere in the markup, so the cooker can see them. Maintained for you on **Save Document**. |

<Warning>
  Do not clear **Font References** by hand. Markup stores fonts as string paths, which the
  cooker cannot follow; without these hard references a packaged build renders fallback
  glyphs wherever a styled run's font failed to cook. Pressing **Save Document** in the
  [Page Editor](/plugins/inkwell/authoring/page-editor) rebuilds the list from every text layer on both sides
  of every page.
</Warning>

### Text markup

A Text layer's `Markup` is UE rich-text markup. A styled run looks like this:

```xml theme={null}
<TextStyle Font="/Inkwell/Fonts/Font_CrimsonText.Font_CrimsonText" Face="Bold" Size="28"
  Color="(R=0.02,G=0.017,B=0.025,A=1.0)" U="1" S="1">text</>
```

Untagged text renders in the document's Default Text Style; `Font` and `Face` are omitted
from a run entirely when unset, so the document default wins. The same rich-text marshaller
drives the in-game bake and the Page Editor's edit box, which is what keeps the two
pixel-identical.

Every attribute, what it inherits, and the rules for generating markup safely are in
[the markup format](/plugins/inkwell/guides/runtime-documents#the-markup-format). Author through the
[Page Editor](/plugins/inkwell/authoring/page-editor) or the Blueprint API rather than by hand — the markup
writer does not escape attribute values.

## The content revision

`ContentRevision` is a transient (never saved) counter bumped on every content change. The
runtime bake cache keys on it, so stale render targets regenerate whenever a document
changes. This is why Page Editor edits show up live on pages already placed in the level,
even during PIE.

If you mutate a document any other way at runtime, call **Bump Revision** (`BumpRevision`)
afterwards. Every Blueprint function below already does.

<Info>
  In the editor, **Bump Revision** also marks the package dirty so authoring changes stay
  saveable — but not during a play session. Data assets are not duplicated for PIE, so
  gameplay mutations deliberately leave the source asset untouched rather than offering to
  save play-time changes into the `.uasset` on exit.
</Info>

## Blueprint API

**Pages** is deliberately read-only from Blueprint: every mutation must invalidate the bake
cache, which a directly writable array could not guarantee. Build and edit documents through
these instead — see [Runtime documents](/plugins/inkwell/guides/runtime-documents) for worked examples.

Every layer function takes a **Side** input (`EInkPageSide`, default Front), so the same
nodes author both faces of a sheet.

### Reading

| Node                           | Kind | Returns                                                                                                                                                       |
| ------------------------------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Get Page Count**             | Pure | Number of pages in the document.                                                                                                                              |
| **Get Page**                   | Pure | Copy of one page's data (a default page if the index is out of range).                                                                                        |
| **Get Page Size Cm**           | Pure | Physical page size: Page Width Cm, with the height derived from the pixel aspect ratio.                                                                       |
| **Get Paper For Page**         | Pure | Paper texture for one side of a page, after the override / generated / document chain. Nothing in the two material modes — the material brings its own paper. |
| **Get Paper Tint**             | Pure | The tint over a side's paper: the front's Paper Tint, or the back's own when its mode differs from Same As Front.                                             |
| **Get Page Layers**            | Pure | One side's layers, back to front. Empty for an out-of-range page — and for an unauthored back.                                                                |
| **Find Text Layer Index**      | Pure | Index of a side's Text layer, or -1 when it has none.                                                                                                         |
| **Has Back**                   | Pure | Whether this sheet has an authored back (any layer in Back Layers).                                                                                           |
| **Has Distinct Back Paper**    | Pure | Whether this page's back *declares* its own paper — a document back mode other than Same As Front, or a per-page back override.                               |
| **Get Effective Default Font** | Pure | The font unstyled text renders in, after the fallback chain.                                                                                                  |

### Writing

| Node                  | Kind     | What it does                                                                                                           |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Add Page**          | Callable | Appends a page and returns its index.                                                                                  |
| **Remove Page**       | Callable | Removes a page. False if the index was out of range.                                                                   |
| **Set Page**          | Callable | Replaces one page wholesale. False on a bad index.                                                                     |
| **Set Page Markup**   | Callable | Replaces the text in a page's **first** text box. False on a bad index.                                                |
| **Set Layer Markup**  | Callable | Replaces the text of one specific Text layer on one side. False on bad indices or a non-text layer.                    |
| **Set Page Layers**   | Callable | Replaces one side's whole layer stack. False if the page index was out of range.                                       |
| **Add Page Layer**    | Callable | Appends a layer to the **front** of one side's stack and returns its index (-1 if out of range).                       |
| **Remove Page Layer** | Callable | Removes one layer. False if either index was out of range.                                                             |
| **Move Page Layer**   | Callable | Moves a layer through the stack; Delta is positive towards the front. Returns the new index, or -1 when nothing moved. |
| **Bump Revision**     | Callable | Invalidates every cached bake of this document.                                                                        |

All of these mutators invalidate cached bakes for you. Everything here is equally available
from C++ on `UInkPageDocument`.

<Note>
  The "a page always has a Text layer" repair is a **front** rule. **Set Page Layers** with
  Side = Back accepts an empty array — that returns the back to its unauthored, zero-cost
  state, which is exactly how you blank a back from Blueprint.
</Note>

<Accordion title="A page I built in Blueprint renders nothing">
  A page with no Text layer has nowhere to draw its writing — the bake walks the layer stack,
  not a markup string. If you construct an `FInkPageSpec` yourself, add it with **Add Page**
  (which guarantees the page a Text layer) rather than pushing it into `Pages`, and set its
  words with **Set Page Markup** or **Set Layer Markup**. If a page still looks blank, check
  the layer's **Visible** flag and its **Opacity**.
</Accordion>

## Next

<CardGroup cols={2}>
  <Card title="Page Editor" icon="pen-nib" href="/plugins/inkwell/authoring/page-editor">
    The window where you actually author all of this.
  </Card>

  <Card title="Layers" icon="clone" href="/plugins/inkwell/authoring/layers">
    The stack model: text boxes, images, drawings, and their order.
  </Card>

  <Card title="Paper" icon="newspaper" href="/plugins/inkwell/authoring/paper">
    Generated paper: ruling, margin rule, punched holes, grain.
  </Card>

  <Card title="Runtime documents" icon="file-pen" href="/plugins/inkwell/guides/runtime-documents">
    Building and editing documents from Blueprint at runtime.
  </Card>
</CardGroup>
