PageNumber

Support

Client-side
Server-side

Returns the current page number.

Examples

Preview

import { PageNumber } from "@onedoc/react-print";

<PageNumber counterStyle="decimal" />;

Custom Style

You can use a custom CSS counter-style, by passing a known name or a custom counter style.

import { PageNumber } from "@onedoc/react-print";

<PageNumber counterStyle="lower-roman" />;

API

Props
counterStyle
string

The style of the counter.

Default: "decimal"

PagesNumber

Support

Client-side
Server-side

Returns the total number of pages.

Examples

Preview

import { PagesNumber, PageNumber } from "@onedoc/react-print";

<>
  <PageNumber counterStyle="decimal" />
  {" of "}
  <PagesNumber counterStyle="decimal" />
</>;

API

Props
counterStyle
string

The style of the counter.

Default: "decimal"

RunningH1

Support

Client-side
Server-side

Returns the current page’s running header of level 1.

Examples

Preview

Show the current running header of level 1 in the page header. All running headers are reset when any of their parent headings are encountered (e.g. a level 2 heading resets the level 3, 4, 5 and 6 headings).

import { RunningH1 } from "@onedoc/react-print";

<React.Fragment>
  <PageTop style={{ paddingTop: "1rem" }}>
    <RunningH1 />
  </PageTop>
  <h1>Heading of level 1</h1>
</React.Fragment>;

RunningH2

Support

Client-side
Server-side

Returns the current page’s running header of level 2.

import { RunningH2 } from "@onedoc/react-print";

RunningH3

Support

Client-side
Server-side

Returns the current page’s running header of level 3.

import { RunningH3 } from "@onedoc/react-print";

RunningH4

Support

Client-side
Server-side

Returns the current page’s running header of level 4.

import { RunningH4 } from "@onedoc/react-print";

RunningH5

Support

Client-side
Server-side

Returns the current page’s running header of level 5.

import { RunningH5 } from "@onedoc/react-print";

RunningH6

Support

Client-side
Server-side

Returns the current page’s running header of level 6.

import { RunningH6 } from "@onedoc/react-print";