Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lameuler/astro-pdf
A simple Astro integration to generate PDFs from built pages.
https://github.com/lameuler/astro-pdf
astro astro-integration pdf pdf-generation puppeteer
Last synced: about 1 month ago
JSON representation
A simple Astro integration to generate PDFs from built pages.
- Host: GitHub
- URL: https://github.com/lameuler/astro-pdf
- Owner: lameuler
- Created: 2024-07-03T07:23:01.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-27T07:45:49.000Z (about 2 months ago)
- Last Synced: 2024-09-30T15:18:34.697Z (about 2 months ago)
- Topics: astro, astro-integration, pdf, pdf-generation, puppeteer
- Language: Astro
- Homepage: https://www.npmjs.com/package/astro-pdf
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# astro-pdf
A simple Astro integration to generate PDFs from built pages.
This package is still under development and is not stable yet.
## Quickstart
Install and add `astro-pdf`:
```sh
npx astro add astro-pdf
```
and follow the CLI prompts.## Example
```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
import pdf from 'astro-pdf'// https://astro.build/config
export default defineConfig({
integrations: [
pdf({
// pages will receive the pathname of each page being built
pages: path => {
if (path === 'testing/') {
return { // return options for pages to be generated
path: 'testing.pdf', // output path
light: true, // set system theme to light
waitUntil: 'networkidle0', // for puppeteer page loading
pdf: { // puppeteer PDFOptions
format: 'A4',
printBackground: true
}
}
}
}
})
]
});
```