0.0.1 • Published 4 months ago

gatsby-plugin-pdf-export v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

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; }'
    }
}

Acknowledgments