files_export_pdf
Exports sheets as a PDF with Excel-style print semantics and returns it base64-encoded. Options mirror Excel's Page Setup: paper size, orientation, margins (inches), zoom or fit-to-pages scaling, page order, centering, gridlines and headings, header/footer with Excel codes (&P page, &N total, &D date, &T time, &F file, &A sheet, &B bold); numbered date and time codes (&D1…&D6, &T1, &T2) take their strings from printedValues, since locale and timezone are the caller's to decide. Each sheet may carry its own saved Page Setup (page setup, print area, print titles, manual breaks — set in the app or imported from xlsx); export uses it by default. sheetOptions[sheetId] overrides the saved values field by field (an empty string or empty list clears one for this export), sheetOptions[sheetId].pageSetup overrides the saved page setup, and the top-level pageSetup applies only to sheets without a saved one. repeatFrozenRows/repeatFrozenCols repeat whatever each sheet has frozen, so a book prints every sheet with its own header; explicit repeat rows/columns win over them. Images placed in cells are printed from the file itself (PNG and JPEG; other formats become a framed placeholder). Rasters a document may unpack are capped: past the cap an image is drawn as a framed placeholder instead. Charts print from the snapshot the client stores in the file, so they come out on every sheet, server-side too; chartImages (base64 PNG keyed by "sheetId!x,y") overrides it, and a chart without a snapshot becomes a framed placeholder — a workbook imported through this API carries no snapshots until a client opens it, so pass chartImages to print its charts. Read-only. Signature: files_export_pdf(file_uuid, options?).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_uuid": "<file_uuid>"
},
"name": "files_export_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | Print options: { sheetIds?, fileName?, printedAt?, printedTime?, printedValues?: { "D1"…"D6", "T1", "T2" }, pageSetup?: { paperSize, orientation, margins, scaling, pageOrder, centerHorizontally, centerVertically, printGridlines, printHeadings, repeatFrozenRows, repeatFrozenCols, header, footer }, sheetOptions?: { "<sheetId>": { pageSetup?, printArea: "A1:F20", repeatRows: "1:2", repeatCols: "A:B", rowBreaks: [5, 20], colBreaks: [3] } } — rowBreaks and colBreaks are 1-based track numbers a new page starts at, never column letters, chartImages?: { "<sheetId>!x,y": base64 PNG } }. Header and footer sections take &P, &N, &D, &T, &F, &A, &B, &I and && ; numbered date and time formats (&D1…&D6, &T1, &T2) print from printedValues. Omit for the sheets' saved setup, or A4 portrait at 100% zoom where nothing is saved; all sheets. | |
| file_uuid | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | ||
| file_uuid | Yes | ||
| pdf_base64 | Yes | ||
| content_type | Yes |