PDF generation configuration in React Native
The table below summarizes the available configuration options for generating PDF documents with React Native.
Option |
Default Value | Description |
---|---|---|
name |
optional |
Name of the created PDF file. |
filePath |
optional |
Path where the new PDF document will be saved. |
override |
false |
If 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. |
template |
blank |
Document background image pattern. Available options are: blank , dot5mm , grid5mm , lines5mm , and lines7mm . |
width |
550 |
Width of the document. |
height |
750 |
Height of the document. |
pageSize |
A4 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. |
rotation |
0 |
Document orientation. Available options are: 0 , 90 , 180 , and 270 . |
backgroundColor |
#ffffff |
Document 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. |