vite-plugin-pdf-preview
Version:
Preview modern webpages as PDF
33 lines (22 loc) • 668 B
Markdown
Preview web pages as PDF using any framework or just plain HTML – powered by Vite and Puppeteer
```sh
npm i vite-plugin-pdf-preview puppeteer
```
```ts
import pdfPreview from "vite-plugin-pdf-preview";
export default defineConfig({
plugins: [
pdfPreview({
pages: ["page.html"],
watch: ["**/*.html", "**/*.css"],
}),
],
});
```
Files in the browser do not reload when their content changes.
On Windows use [Sumatra PDF](https://www.sumatrapdfreader.org/free-pdf-reader) to have file content update automatically.
Recommendations for other platforms welcome.