exportPresentationPdfWithHttpInfo method
Render the presentation as a PDF.
Proxies to the Spatio export sidecar (Playwright). Two response modes selected via ?storage=: - stream (default) — response body is the PDF binary (application/pdf). - r2 — uploads the rendered PDF to R2 storage and returns a JSON envelope with a 24-hour signed URL. Returns 503 Service Unavailable when the export sidecar is not configured (dev fallback to the client-side exporter).
Note: This method returns the HTTP Response.
Parameters:
-
String id (required): Presentation id.
-
String accountId: Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with
provider. If omitted on a list endpoint the call fans out across every connected account. -
String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
-
String storage:
-
String filename: Sanitized base name for the downloaded PDF.
-
ExportPDFRequest exportPDFRequest:
Implementation
Future<Response> exportPresentationPdfWithHttpInfo(String id, { String? accountId, String? xWorkspaceID, String? storage, String? filename, ExportPDFRequest? exportPDFRequest, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/slides/{id}/export/pdf'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = exportPDFRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (accountId != null) {
queryParams.addAll(_queryParams('', 'accountId', accountId));
}
if (storage != null) {
queryParams.addAll(_queryParams('', 'storage', storage));
}
if (filename != null) {
queryParams.addAll(_queryParams('', 'filename', filename));
}
if (xWorkspaceID != null) {
headerParams[r'X-Workspace-ID'] = parameterToString(xWorkspaceID);
}
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}