gatsby-plugin-pdf-export
v0.0.1
Published
Export Gatsby pages to PDFs at build time
Downloads
5
Readme
Getting Started
Installation
npm i gatsby-plugin-pdf-export
Usage
In your gatsby-config.js:
{
plugins: [
{
resolve: 'gatsby-plugin-pdf-export',
options: {
targetPaths: []
}
}
]
}
Options
Target Paths
List of paths to generate PDFs for.
options: {
targetPaths: ['/', '/events/']
}
Output Path
Directory to store generated PDF files
options: {
outputPath: 'public/pdfs'
}
Output Prefix
Prefix for generated PDF files
options: {
outputPrefix: 'printable-'
}
PDF Options
PDF options passed directly to Puppeteer. See https://pptr.dev/api/puppeteer.pdfoptions
options: {
pdfOptions: {
scale: 2
}
}
Style Options
Style tag options passed directly to Puppeteer. See https://pptr.dev/api/puppeteer.frameaddstyletagoptions
options: {
styleOptions: {
content: '.copy { margin: 5em; }'
}
}