The journal · 29 November 2026 · 6 min read
Delphi HTML to PDF With an Embedded Browser or a Rendering API and What a Year Costs
Delphi has no HTML engine, so every route embeds a browser or calls an API. At 15,000 documents a month the API route costs about $888 in year one against about $5,760 for an embedded component.
Live demo
Runs in your browser. Nothing is uploaded. One PDF free to try, then a plan.
Your HTML
Live preview
Your PDF is downloading. That was the free one. The Starter plan converts as many as you need, for $49 a month or $288 a year, half price.
See the planSitePDF is an HTML to PDF API, and this article answers the question a Delphi team asks before adding PDF output to a billing or reporting application: embed a browser component and own its upgrades, or send the HTML to a rendering API, and what each costs over a year. The short answer is that an embedded component is right for a desktop tool that must work offline, and an API is cheaper and easier to keep alive for a server or a customer facing service that emails statements.
The short answer
Delphi has no HTML layout engine in the VCL or FMX, and the old reporting components draw boxes from a band layout rather than from HTML and CSS. So a modern HTML template, the kind a web designer maintains, has to go through a browser engine. Offline desktop software should embed one. A service that runs on a server or sends documents to customers is simpler with an API call, because the browser stays out of your installer, your patch cycle and your support queue.
What are the options for HTML to PDF in Delphi?
| Route | Engine | Works offline | What you operate |
|---|---|---|---|
| TEdgeBrowser with WebView2 print to PDF | Chromium (Edge) | Yes | A WebView2 runtime on every machine, a visible or hidden window and a message loop |
| CEF4Delphi | Chromium | Yes | Large binaries shipped with the app, version bumps and sandbox setup |
| wkhtmltopdf called as an external program | Old WebKit | Yes | An archived project with no modern CSS, see the wkhtmltopdf alternative page |
| Band based report tools | None | Yes | You rebuild every layout in the report designer, there is no HTML input |
| Rendering API over HTTP | Managed Chromium | No | An API key and one request |
Microsoft documents the WebView2 control in its WebView2 documentation, and the Chromium Embedded Framework wrapper for Delphi is maintained in the public CEF4Delphi repository. Both print real Chromium output. The question is not quality, it is who owns the browser afterwards.
Why is a browser inside a Delphi application a maintenance job?
WebView2 depends on a runtime that has to be present on the target machine, which is a support call waiting to happen on locked down customer PCs and on older Windows Server images. CEF4Delphi ships its own Chromium files with the application, so every security release of Chromium means a new build and a new installer for your customers.
Printing from either one also expects a window. A background Windows service has no desktop, so teams end up with a hidden form, a message pump and a watchdog that restarts it when a page hangs. That is a small amount of code written once and a long tail of odd bugs on customer machines.
Fonts add a third cost. A server without the fonts your template names prints fallback glyphs, and the fault appears only in production. The fonts article lists the usual causes.
What does each route cost in year one at 15,000 documents a month?
These are planning assumptions, not measurements, so replace them with your numbers. A Delphi billing application sends 15,000 invoices and statements a month from a server. Embedding a browser component means 30 hours to integrate, package and test, then 2 hours a month on runtime and Chromium updates and customer incidents, at $100 an hour, plus a $30 a month worker machine.
| Item | Basis | Year one cost |
|---|---|---|
| Integrate, package and test the component | 30 hours at $100 | $3,000 |
| Runtime and Chromium updates, incidents | 2 hours a month at $100 | $2,400 |
| Worker machine | $30 a month | $360 |
| Embedded component total | $5,760 | |
| Integrate the API from Delphi | about 3 hours at $100 | $300 |
| SitePDF Growth, 50,000 renders a month | $99 list, $588 billed yearly | $588 |
| API total | $888 |
At 15,000 documents a month you are above the 10,000 renders of Starter API ($49 a month, $288 billed yearly), so Growth is the plan that fits. Only the $588 repeats in year two. A desktop product that already embeds Chromium for its interface has a smaller integration line, and the gap narrows.
How do you call a rendering API from Delphi?
Delphi ships with THTTPClient in System.Net.HttpClient, so no third party package is needed. Build the HTML with your own template code and post it as JSON. The response carries a link to the PDF.
var
Http: THTTPClient;
Body: TStringStream;
Resp: IHTTPResponse;
begin
Http := THTTPClient.Create;
Body := TStringStream.Create(
'{"html": ' + TJSONString.Create(InvoiceHtml).ToJSON +
', "format": "Letter", "archive": true}', TEncoding.UTF8);
try
Http.CustomHeaders['Authorization'] := 'Bearer ' + GetEnvironmentVariable('SITEPDF_KEY');
Http.ContentType := 'application/json';
Resp := Http.Post('https://api.sitepdf.com/v1/render', Body);
// Resp.ContentAsString holds the JSON with the link to the PDF
finally
Body.Free;
Http.Free;
end;
end;
The render runs in managed Chromium, so flexbox, web fonts and CSS page breaks behave as in a desktop browser. For multi page statements the footer can carry "Page 2 of 7" through header and footer fields on the render call. With archive set to true each render is also stored with a capture time and a SHA-256 hash, described on the invoice PDF archive page.
Who this is for and who it is not for
It is for Delphi teams whose application or service sends invoices, statements or reports built from HTML and wants one layout without owning a browser. It is not for a desktop product that must print with no network connection, or documents that may never leave the customer's premises. Those should stay with WebView2 or CEF4Delphi.
What to do this week
Count how many PDFs you produce a month and how many hours your team spent on the browser component last quarter. If the product is offline, stay with the embedded route. If it is a service, post one real invoice to SitePDF and compare the output with your current one. The pricing page lists every plan, and the sister article on C++ with an embedded browser against an API runs the same sums for another native stack.
Frequently asked questions
How do I convert HTML to PDF in Delphi?
Delphi has no HTML engine of its own. Load the HTML into an embedded Chromium control such as TEdgeBrowser or CEF4Delphi and use its print to PDF function, or post the HTML to a rendering API with THTTPClient and receive the PDF. The first works offline, the second removes the browser from your installer.
Can TEdgeBrowser print HTML to PDF?
Yes, on versions of Delphi that include TEdgeBrowser with a WebView2 runtime installed. It prints with Chromium, so modern CSS works, but the control needs a window and the runtime on every target machine.
Is wkhtmltopdf still a good choice in Delphi?
It is archived and based on an old WebKit, so grid and many flexbox layouts fail. It still handles plain documents, but new projects usually choose a Chromium based route.
How much does an HTML to PDF API cost for a Delphi application?
SitePDF Starter API is $49 a month for 10,000 renders, or $288 billed yearly. Growth is $99 a month for 50,000 renders and Scale is $299 a month for 250,000. Count one render per document.
Written by the team behind SitePDF, an HTML to PDF API that archives every page it renders. The in-browser converter is free to try, and API plans start at $49 a month, half price billed yearly.