Skip to content

Rich-Harris/sveltekit-pdf-demo

Repository files navigation

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.

About

Using SvelteKit to generate PDFs dynamically

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published