/sveltekit-pdf-demo

Using SvelteKit to generate PDFs dynamically

Primary LanguageTypeScript

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.