ForHosting KIT · Documents & PDF

Text to PDF

Feed us raw text and we hand back a properly paginated PDF — line breaks respected, margins set, pages numbered where you need them. It is the quiet workhorse behind receipts, transcripts, logs, and any moment where a string in your database has to become a document a human can print, sign, or archive. One POST, one predictable file.

● StablePer request + per page$0.002
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The gap this closes

Every application eventually accumulates text that someone downstream wants as a file: an order confirmation, a support-ticket export, a batch of meeting notes, a chunk of terms and conditions. Rendering that yourself means bundling a PDF engine, wrestling with fonts, and babysitting memory when a document runs long. The text to pdf api removes all of it. You send the string; we handle pagination, encoding, and the byte-level plumbing of the PDF format so your codebase stays lean and your team stays focused on the product.

How a request behaves

You call POST /pdf/from-text with your text and any options you care about, and you immediately get a task_id. The work happens asynchronously on our global edge, which means a two-line note and a two-hundred-page dump are treated the same way from your side — you never hold a connection open waiting on the render. When the PDF is ready we push it to your webhook, or you fetch it from a signed link. Nothing about the call blocks your request thread.

Why plain text still matters

PDF was designed in the early 1990s to make a document look identical on every machine, and that promise is exactly why it never went away — invoices, legal filings, and boarding passes all still ride on it. Plain text, meanwhile, is the most durable input a system can produce: no markup to sanitize, no layout engine to satisfy, just characters and newlines. Bridging the two is a genuinely common need, and doing it well means respecting whitespace, wrapping long lines cleanly, and paginating without orphaning a stray word onto a lonely page.

Delivery you can trust

Results arrive by a signed webhook, which we recommend because your systems learn about the file the instant it exists, or through a signed link that stays valid for 24 hours if you would rather pull. After the retention window your text and the generated PDF are deleted, and neither is ever used to train anything. If a render fails we retry three times with backoff before returning a clear error — and a failed task is never billed.

Where it fits in a pipeline

Because the endpoint is async and stateless, it drops naturally into queues, cron jobs, and event-driven flows. Fan out ten thousand statements overnight and let the webhooks land as each finishes; wire it behind a Download button and hand users a signed link on demand. Access needs prepaid balance — no free tier, which is deliberate: it keeps the queue fast, the abuse out, and the price honest at a flat $0.002 per request, billed per page, with a failed task costing nothing.

Order and payment receipts

An e-commerce checkout composes the receipt as plain text — items, totals, tax lines — and posts it here. The customer gets a tidy, printable PDF attached to their confirmation email seconds later, with no PDF library shipped inside the store.

Support ticket and chat exports

A help desk lets agents export a full conversation thread for compliance. Each transcript is sent as text and returned as a paginated PDF that can be attached to a case file or handed to an auditor.

Nightly log and report snapshots

A monitoring job collects the day's plain-text summary and converts it into a dated PDF for archival, so months of operational history stay searchable and shareable without keeping a rendering service running in-house.

On-demand document downloads

A SaaS dashboard shows a Download PDF button next to notes and agreements. The click triggers a request and the user receives a signed link the moment the file is generated — no queue of pre-built files to maintain.

How do I convert text to PDF with an API?

Send a POST request to /pdf/from-text with your plain text in the body. You get a task_id back immediately, and the finished PDF arrives at your webhook or through a signed link once rendering completes.

Is the text to PDF API free?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

How is the PDF delivered back to me?

By a signed webhook, which we recommend so your system is notified the instant the file exists, or by a signed link that stays valid for 24 hours. After the retention window the file and your text are deleted.

Can I generate PDFs in bulk?

Yes. The endpoint is asynchronous, so you can fire thousands of requests without waiting on any of them. Each returns its own task_id and its own delivery, which makes overnight batch jobs straightforward.

Does it handle long documents and pagination?

It does. Long text is wrapped and split across as many pages as needed, and because you are billed per page you only pay for the length you actually produce.

What happens if a request fails?

We retry up to three times with backoff. If it still cannot complete, you receive a clear error and the task is not billed, so failures never cost you anything.

Do you store or train on my text?

No. Your input text and the generated PDF are held only for the retention window and then deleted, and neither is ever used to train any model.

Why did I get a 402 response?

A 402 means there is no prepaid balance or the balance is empty. Adding balance to an active plan restores access; this gate is what keeps the service fast and free of abuse.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/from-text

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/pdf/from-text \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pdf":"https://ejemplo.com/documento.pdf"}'
{
  "pdf": "https://ejemplo.com/documento.pdf"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.from_text",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
413input_too_largeThe file exceeds the size limit.

Read the full KIT documentation →