FZPure suite
FZPureHTML
HTML to PDF in pure PHP.
Write your document in HTML with the bundled stylesheet, call one function, get the PDF. Two files to copy to your server.
Projects · FZPure suite
DOCX and PDF documents from Word templates. A small PHP server that fills Word templates, replacing placeholders with text, HTML, tables and checkboxes, and returns DOCX or PDF.
Code on GitHub Download the latest release
Quotes, contracts, reports: the people who use them want to edit them in Word, the software that produces them wants to fill them in automatically. The usual solutions cost a licence or need software installed on the server.
The template stays a normal Word file with placeholders. Your application sends it with an HTTP POST request together with the data, and gets back a JSON response with the filled document, as DOCX and/or PDF. The PDF comes from LibreOffice when it is installed, otherwise from the bundled pure-PHP converter.
$post = [
'apikey' => 'YOUR_KEY',
'modello_docx' => base64_encode(file_get_contents('template.docx')),
'vars' => ['surname' => 'Smith'],
'converti_pdf' => 'si',
];
// POST to gdocx.php → JSON with DOCX and PDF in base64
// (API field names are in Italian; the README explains each one)
Requirements: PHP 8.1+ with zip, dom, zlib, mbstring. Apache with .htaccess. LibreOffice optional.
Installation, configuration and the full reference are in the README on GitHub.
FZPureDOCX is free and open source. If you find it useful, you can buy me a coffee: it is a simple way to support its development.
FZPure suite
HTML to PDF in pure PHP.
Write your document in HTML with the bundled stylesheet, call one function, get the PDF. Two files to copy to your server.
New releases, development notes and what I learn along the way.