PDF generation configuration in React Native

The table below summarizes the available configuration options for generating PDF documents with React Native.

OptionDefault ValueDescription
nameoptionalName of the created PDF file.
filePathoptionalPath where the new PDF document will be saved.
overridefalseIf a PDF with the same name already exists in the local iOS/Android folder, enabling this option will delete the existing document and generate a new one with the same name.
templateblankDocument background image pattern. Available options are: blank, dot5mm, grid5mm, lines5mm, and lines7mm.
width550Width of the document.
height750Height of the document.
pageSizeA4 format: {width: 595, height: 842}Document size in width and height.
margins{top: 30, right: 15, bottom: 30, left: 15}Content padding in the document.
rotation0Document orientation. Available options are: 0, 90, 180, and 270.
backgroundColor#ffffffDocument background color. You can provide many formats for the color attribute: #ffffff, rgb(255,255,255), or blue.
images['imagePath']Array of images from which to generate a PDF.
documents['documentPath', 0]Array of documents and the page indexes from which to generate a PDF.