sveltekit-pdf-demo

Sveltekit Pdf Demo

Using SvelteKit to generate PDFs dynamically

https://sveltekit-pdf-demo.vercel.app

This showcases the read function from $app/server, added in SvelteKit 2.4.0. It allows you to read an asset directly from the filesystem in Node-based deployments (with support planned for other runtimes in future):

import FuturaPTCondBold from './fonts/FuturaPTCondBold.otf';
import { read } from '$app/server';

const font = await read(FuturaPTCondBold).arrayBuffer();

Any assets that are imported in this way will be included in the deployment.

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes