JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 120
  • Score
    100M100P100Q82075F
  • License MIT

A simple Astro integration to generate PDFs from built pages

Package Exports

  • astro-pdf
  • astro-pdf/dist/cjs/integration.js
  • astro-pdf/dist/es/integration.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (astro-pdf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

astro-pdf

A simple Astro integration to generate PDFs from built pages.

This package is still under developement and is not stable yet.

Quickstart

Install and add astro-pdf:

npx astro add astro-pdf

and follow the CLI prompts.

Example

// 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
                        pdf: { // puppeteer PDFOptions
                            format: 'A4',
                            printBackground: true
                        }
                    }
                }
            }
        })
    ]
});