Papers
Download a paper
Download a paper's original file.
Download the original file you uploaded.
const file = await paperful.papers.download("00000000-0000-0000-0000-000000000000"); The file is returned as a File, with its name and type set.
Save to disk
import { writeFile } from "node:fs/promises";
const file = await paperful.papers.download("00000000-0000-0000-0000-000000000000");
await writeFile(file.name, Buffer.from(await file.arrayBuffer())); If the paper doesn't exist, a NotFound error is thrown.