Download PDF
Downloads a generated PDF (or spatial ZIP bundle) by its ID or direct URL. You can save it directly to your file system or return it as a raw Node.js memory Buffer.
// 1. Download directly to a local directory
const fileResult = await client.download('pdf-uuid-here', { outputDir: './downloads' });
console.log(fileResult);
/*
{
pdfFilePath: 'downloads/document.pdf'
}
*/
// 2. Download into memory as a Buffer
const bufferResult = await client.download('pdf-uuid-here');
console.log(bufferResult);
/*
{
pdfBuffer: <Buffer 25 50 44 46 2d ... >,
testResults: null
}
*/