render.pdf
render.pdf(input: ProjectModeInput): Promise<Uint8Array<ArrayBufferLike>> Render a PDF and return its raw bytes. Two HTTP calls under the hood: POST /v1/render to produce a stored document, then GET presignedPdfUrl to fetch the bytes.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
input | ProjectModeInput | required | (no description) |
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Errors
Section titled “Errors”| Code | When |
|---|---|
VALIDATION_ERROR | See [errors](../../../production/errors/) for the full description. |
NOT_FOUND | See [errors](../../../production/errors/) for the full description. |
QUOTA_EXCEEDED | See [errors](../../../production/errors/) for the full description. |
timeout | See [errors](../../../production/errors/) for the full description. |
network_error | See [errors](../../../production/errors/) for the full description. |
INTERNAL_ERROR | See [errors](../../../production/errors/) for the full description. |
Example
Section titled “Example”// Demonstrates: client.render.pdf(input) — project mode only.import { PoliPage } from '@poli-page/sdk';
const client = new PoliPage({ apiKey: process.env.POLI_PAGE_API_KEY! });
const pdf = await client.render.pdf({ project: 'billing', template: 'invoice', data: { invoiceNumber: 'INV-001', total: 1280 },});
// `pdf` is a Uint8Array of PDF bytes.console.log(`Rendered ${pdf.byteLength} bytes`);