Convert Anything to PDF
convert_anything_to_pdfConvert a wide range of files - images, documents, EPUB, and more - into PDF using a local path or URL. Use when you need a PDF regardless of the source format.
Instructions
Convert almost any FILE to PDF through one catch-all endpoint. Input is an absolute local filesystem path OR an http(s) URL pointing at the file itself. Accepted extensions, exactly 36: .bmp, .csv, .doc, .docx, .epub, .gif, .heic, .heif, .htm, .html, .jpeg, .jpg, .markdown, .md, .mdown, .mkd, .numbers, .odp, .ods, .odt, .ots, .pages, .pdf, .png, .ppt, .pptx, .rtf, .svg, .text, .tif, .tiff, .txt, .webp, .xhtml, .xls, .xlsx. A .pdf input is accepted and passed through, so together with pdf_options.grayscale this doubles as a PDF normalize and grayscale path.
Use when: the input format is unknown, unusual, or varies from call to call and a PDF is wanted regardless; putting an image into a PDF (png, jpg, jpeg, webp, gif, bmp, tif, tiff, heic, heif) or an SVG, RTF, Apple Pages or Apple Numbers file into a PDF; "make a PDF out of this, whatever it is"; converting an existing PDF to grayscale or re-normalizing it.
Do NOT use when: the source is a LIVE web page (use perceive_url with outputs ['pdf']); the wanted output is NOT a PDF (use convert_image, convert_document, or convert_anything_to_markdown). This tool deliberately OVERLAPS convert_document: convert_document stays the right choice for the KNOWN office-to-pdf pairs (doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp, ots, html, md) and for the structured-data pairs (json, xml, yaml, toml, csv), while convert_anything_to_pdf is the SINGLE catch-all for everything else: an unknown or unusual input format, images, SVG, RTF, HEIC, TIFF, iWork files, EPUB (which has no convert_document pair), or a PDF that merely needs normalizing or grayscaling.
Returns: a presigned download URL of the .pdf plus metadata and a jobId; pass save_to (absolute path) to also write it locally. pdf_options CAVEAT: full page geometry (page_size, orientation, margins, scale) is honored ONLY for html, htm, xhtml, markdown, plain text, epub, image and svg input. Office, ODF, iWork, RTF and CSV input plus PDF passthrough accept "grayscale" ONLY and are rejected with a 400 when any explicit geometry option is set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute local filesystem path to the file to convert, OR an http(s):// URL pointing at the file itself. Relative paths are rejected, so always pass an absolute path. | |
| context | Yes | Explain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization." | |
| save_to | No | Optional absolute local path to also save the generated PDF. | |
| pdf_options | No | Optional PDF rendering options. | |
| output_filename | No | Desired output filename (without extension). |