File Conversion
file.convert converts between images, PDF, OFD, and TIFF. Inputs can come from local paths, uploaded input_upload_id, or source.base64.
Images to PDF
json
{
"request_id": "req-file-001",
"method": "file.convert",
"params": {
"source": {
"type": "images",
"input_upload_ids": ["img-001", "img-002"]
},
"target": {
"type": "pdf"
},
"options": {
"export_type": "multi-page",
"quality": 90
}
}
}Document to Images
json
{
"request_id": "req-file-002",
"method": "file.convert",
"params": {
"source": {
"type": "pdf",
"input_path": "/tmp/source.pdf",
"pages": "1-3"
},
"target": {
"type": "jpg",
"dir": "/tmp/pages"
},
"options": {
"export_type": "single-page",
"render_dpi": 144
}
}
}Constraints
- Output formats:
jpg,png,tiff,pdf, andofd. jpgandpngsupport onlyexport_type=single-page.pdf,ofd, andtiffdocument inputs accept only one input file.- Image inputs support
jpg,jpeg,png,bmp,tif,tiff, andwebp.
The response returns output_path, output_paths, assets, and outputs. Asset reads follow the same pattern as capture tasks.