Export API
Server routes for PDF document export.
POST /api/export/pdf
Generate a PDF from document builder pages.
Request Body
typescript
{
projectId: string
pages: PageData[] // Page content and layout
options?: {
format?: 'A4' | 'letter'
orientation?: 'portrait' | 'landscape'
includecover?: boolean
includeToc?: boolean
}
}Response
json
{
"jobId": "uuid",
"status": "processing"
}GET /api/export/render/[projectId]
Render project pages for preview.
Parameters
| Param | Type | Description |
|---|---|---|
projectId | string | Project UUID (URL parameter) |
GET /api/export/status/[jobId]
Check export job status.
Parameters
| Param | Type | Description |
|---|---|---|
jobId | string | Export job UUID (URL parameter) |
Response
json
{
"status": "completed",
"downloadUrl": "signed-url-to-pdf",
"pageCount": 12
}Source
server/api/export/