# gatsby-plugin-pdf-export

> Export Gatsby pages to PDFs at build time

Latest version **0.0.1** (published 2024-01-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install gatsby-plugin-pdf-export
pnpm add gatsby-plugin-pdf-export
yarn add gatsby-plugin-pdf-export
bun add gatsby-plugin-pdf-export
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2024-01-02 |
| First published | 2024-01-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.15.0 |
| Dependencies | 5 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | matthewmincher |
| Keywords | gatsby, pdf |

## Links

- npm: https://www.npmjs.com/package/gatsby-plugin-pdf-export
- Repository: https://github.com/matthewmincher/gatsby-plugin-pdf-export
- Homepage: https://github.com/matthewmincher/gatsby-plugin-pdf-export#readme
- Issues: https://github.com/matthewmincher/gatsby-plugin-pdf-export/issues
- npm.io page: https://npm.io/package/gatsby-plugin-pdf-export

## Dependencies (5)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [puppeteer](https://npm.io/package/puppeteer.md) ^21.6.1
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.23.7
- [gatsby-core-utils](https://npm.io/package/gatsby-core-utils.md) ^4.13.0
- [gatsby-plugin-utils](https://npm.io/package/gatsby-plugin-utils.md) ^4.13.0

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2024-01-02

## README

<a name="readme-top"></a>

<br />
<div align="center">
  <a href="https://www.gatsbyjs.com">
    <img src="https://www.gatsbyjs.com/Gatsby-Monogram.svg" alt="Logo" width="80">
  </a>

<h3 align="center">gatsby-plugin-pdf-export</h3>

  <p align="center">
    Export PDF versions of pages at build time
    <br />
   </p>
</div>

## Getting Started
### Installation
```
npm i gatsby-plugin-pdf-export
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

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

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Acknowledgments
* [Gatsby JS](https://gatsbyjs.com)
* [gatsby-plugin-pdf](https://github.com/lundegaard/gatsby-plugin-pdf)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

---
_Source: https://npm.io/package/gatsby-plugin-pdf-export · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
