Skip to content
pdfconversionapi

LOG to PDF API

POST /v2/convert/log/to/pdf prints a log file to PDF. The log is read as plain text: each line becomes a paragraph on Letter pages, and lines longer than the page wrap at the margin, so the 23-line sample takes 36 printed lines over 2 pages.

Endpoint
POST /v2/convert/log/to/pdf
Accepts
log
Sample timing
24 ms median of 5 runsHow we measure
Request size
Up to 10 MB on the Free plan or 100 MB on paid plans, all files together

Request and response

Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.

curl -sS -X POST \
  https://api.pdfconversionapi.com/v2/convert/log/to/pdf \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@invoice-worker.log \
  -o response.json

# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
  mkdir -p converted
  name=$(jq -r '.Files[0].FileName' response.json)
  jq -r '.Files[0].FileData' response.json \
    | base64 --decode > "converted/$name"
else
  cat response.json
fi
200 OK24 ms median1 file, 22 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.024,
  "Files": [
    {
      "FileName": "invoice-worker.pdf",
      "FileExt": "pdf",
      "FileSize": 22229,
      "FileData": "JVBERi0xLjcKJYCAgIAKMSAw…"
    }
  ]
}

Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.

The sample, converted

The same file the code sends. Download the input and the output and compare them yourself.

First page of invoice-worker.pdf, rendered by the API
Input
invoice-worker.log (2.1 KB)
Output
invoice-worker.pdf (22 KB)
Source
A log from a fictional invoice service, written by us: 23 lines with a stack trace and a long JSON line (CC0-1.0). How it was made
Made by
2026-11-04, API build 9eeeb0640aba

Parameters

Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.

ParameterWhat it does
FileNamestringPDF name without the extension; FileName=worker-nov1 gives worker-nov1.pdf.
StoreFileboolean, default falseKeep the PDF for 3 hours and return a link instead of the bytes.

Not supported yet

Setting one of these to anything but its default returns 400.

OptionWhat to do instead
PageRangeReturns 400 "PageRange is not supported yet for LOG → PDF". Keep pages afterwards with /v2/convert/pdf/to/extract.
PdfaVersionAny value but none returns 400. Make an archival copy with /v2/convert/pdf/to/pdfa.

What carries over, and what doesn't

Kept

  • Every line in order, timestamps and levels included: the sample's 23 lines start 23 paragraphs
  • Indentation inside lines: the three stack frames keep their 4 leading spaces
  • Non-ASCII characters such as the € in the JSON event line
  • Text you can select, copy and search, in an embedded Carlito subset, with a structure tree

Lost or not yet supported

  • One entry per printed line. Long lines wrap, and a stretch without spaces is broken mid-word: in the sample's JSON event, "total" is split across two lines.
  • Column alignment. Fields that line up in a terminal's fixed-width font drift, because the PDF uses Carlito 12 pt, a proportional font.
  • Density: each line gets 8 pt of space after it, so the 2,126-byte sample needs 2 Letter pages.
  • PDF/A: Pdfa=true is not a documented option for this pair and is ignored, so the file is a regular PDF.

Limits

  • Page size, font and margin options are not read for logs and are ignored. Pages are Letter with 1 in margins.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together. A conversion can run for up to 120 seconds; after that the API returns 504.

Where teams use it

Evidence for incident reviews

Attach the log of an outage to a postmortem or a customer report as a PDF that can't be edited by accident and opens on any device.

Audit and compliance packets

When auditors ask for access or job logs as documents rather than raw files, a PDF per log keeps the text searchable inside the packet.

Printing logs for people without a terminal

Support staff and managers can read a printed or PDF log in their own viewer, with the long entries wrapped to the page instead of running off the screen.

Questions

Can the log be printed in a monospace font?

Not on this route. A workaround we tested with a plain-text file: wrap the text in a Markdown code fence (a line of three backticks before and after it), save it as .md and send it to /v2/convert/md/to/pdf. The text is set in Liberation Mono 10 pt there, aligned columns stay aligned, and that route accepts PageSize and margins.

What encodings can the log use?

UTF-8, with or without a byte order mark, or UTF-16 with one. A log in an older code page is recognized from its bytes: our Windows-1252 and Windows-1251 (Russian) test logs printed as written. /v2/convert/log/to/txt is stricter, because it reads any other bytes as Windows-1252, so send a Russian or Polish log here directly rather than through that route first.

Why do I get 400 for PageRange?

ConvertAPI documents PageRange for this conversion, but our converter doesn't apply it yet, and it refuses rather than return all pages silently. Convert the whole log and cut pages with /v2/convert/pdf/to/extract.

Is there a size limit for logs?

The request limit is {upload}, and the conversion must finish within 120 seconds or the API returns 504. For very large logs, filter them to the time window you need before converting.

Convert your first LOG file in a minute.