Rich-Harris / sveltekit-pdf-demo

Using SvelteKit to generate PDFs dynamically

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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


Languages

Language:TypeScript 33.7%Language:JavaScript 31.2%Language:Svelte 27.1%Language:HTML 8.0%