gatsby-plugin-pdf-export

0.0.1 • Public • Published


Logo

gatsby-plugin-pdf-export

Export PDF versions of pages at build time

Getting Started

Installation

npm i gatsby-plugin-pdf-export

(back to top)

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

(back to top)

Acknowledgments

(back to top)

Readme

Keywords

Package Sidebar

Install

npm i gatsby-plugin-pdf-export

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

8.7 kB

Total Files

12

Last publish

Collaborators

  • matthewmincher