---
title: "Anything To Pdf"
method: POST
path: "/v1/convert/anything-to-pdf"
tags: ["v1", "v1-convert"]
---

# Anything To Pdf

`POST /v1/convert/anything-to-pdf`

## Request

- Base URL: `https://api.enconvert.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.enconvert.com/v1/convert/anything-to-pdf`
- Auth: none declared

Convert an uploaded file of (almost) any format to PDF.

File-based only (no URLs). Auto-detects the input format by extension and
dispatches to the right engine: LibreOffice (DOC/DOCX/XLS/XLSX/PPT/PPTX/ODF/
Pages/Numbers/RTF/CSV), WeasyPrint (HTML/Markdown/plain text/EPUB), Pillow
(PNG/JPEG/GIF/BMP/TIFF/WebP/HEIC) or CairoSVG (SVG). A PDF upload is accepted
and passed through, which — with pdf_options.grayscale — doubles as a PDF
grayscale/normalise path.

Args:
    file: The document or image to convert.
    output_filename: Optional custom output name (defaults to input name .pdf).
    direct_download: If True (default), return the file; else JSON metadata.
    pdf_options: Optional JSON string. Page geometry (page_size, page_width/
        height, orientation, margins, scale, header, footer) is honoured for
        HTML/Markdown/plain text/EPUB/image/SVG input. Office and PDF input
        support ``grayscale`` only — their page layout comes from the source
        document — and reject an explicitly-set geometry option with a 400.

## Headers

- `X-API-Key` string, nullable
- `authorization` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/enconvert/apis/conversion-api.md) · [All operations](https://skmtc.dev/enconvert/apis/conversion-api/llms.txt) · [OpenAPI document](https://skmtc.dev/enconvert/apis/conversion-api/revisions/b8c820393569?raw)
