GitHub
ComponentsPage

Page

Represents single page inside the PDF documents, or a subset of them if using the wrapping feature. A <Document /> can contain as many pages as you want, but ensures not rendering a page inside any component besides Document.

import { Document, Page, Text } from '@react-pdf/renderer';

const MyDocument = () => (
  <Document>
    <Page size="A4" orientation="landscape" style={{ padding: 40 }}>
      <Text>A landscape A4 page with a 40pt margin</Text>
    </Page>
  </Document>
);
Show preview

Valid props

Prop nameDescriptionTypeDefault
sizeDefines page size. If String, must be one of the available page sizes. Height is optional, if ommited it will behave as "auto".String, Array, Number, Object"A4"
orientationDefines page orientation. Valid values: "portrait" or "landscape"String"portrait"
wrapEnables page wrapping for this page. See moreBooleantrue
styleDefines page styles. See moreObject, Arrayundefined
debugEnables debug mode on page bounding box. See moreBooleanfalse
dpiEnables setting a custom DPI for page contents.Number72
idDestination ID to be linked to. See moreStringundefined
bookmarkAttach bookmark to element. See moreString or Bookmarkundefined

On this page