Download the PHP package veoksha/pdfit without Composer

On this page you can find all versions of the php package veoksha/pdfit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pdfit

Pdfit — Laravel Document to PDF Converter

Convert DOCX, Excel, PowerPoint, images, HTML, and Markdown to PDF in Laravel. One package, 20+ formats, no cloud API, no microservice. Works with Docker, Google Cloud Run, and Azure.

Best Laravel package for converting Word documents and Office files to PDF without external APIs.

Author: Mohit Anand | Contact: [email protected] | [email protected]


How do I convert DOCX to PDF in Laravel?

Install with composer require veoksha/pdfit. The package auto-installs Python tooling via uv—no manual setup. Everything runs on your server; no SaaS, no API keys.


What Is This?

Laravel/PHP is weak at document conversion. Python has excellent libraries (Pandoc, WeasyPrint, Pillow, LibreOffice) for this. Pdfit bridges them:

Everything runs locally. Supports Azure, Google Cloud Run, Docker.


Supported Formats

Category Formats Engine
Office docx, doc, pptx, ppt, xlsx, xls, odt, ods, odp LibreOffice / pypandoc
Web & Text html, htm, md, markdown, txt, rtf, csv weasyprint / pypandoc
Images png, jpg, jpeg, gif, bmp, tiff, tif, webp Pillow
Other epub, zip pypandoc / ebooklib / merge

ZIP Files

A ZIP is treated as a bundle: the package extracts supported files inside, converts each to PDF, and merges them into one PDF. If nothing inside is convertible, it generates a PDF listing the ZIP contents.


Why Pdfit? (vs DOMPDF, Spatie, Doxswap)

Pdfit DOMPDF / Spatie Doxswap
DOCX → PDF ✅ LibreOffice/pypandoc ❌ HTML only ✅ LibreOffice
Excel, PowerPoint ⚠️ Limited
Images → PDF ✅ Pillow
HTML, Markdown ✅ WeasyPrint ✅ DOMPDF
Python setup Auto (uv) N/A N/A
Single API Converter::toPdf() Varies Yes

Use Pdfit when you need to convert user uploads (Office, images, HTML) to PDF in one package, without cloud APIs.


Requirements

Requirement Notes
PHP 8.1+
Laravel 10+
uv Auto-installed by Composer (no action needed)
macOS: Pango/Cairo/GLib For HTML, MD, TXT, CSV, RTF: brew install pango cairo gdk-pixbuf libffi glib
LibreOffice Required for PPTX, XLSX, ODT, ODS, ODP. See Installation

Composer Dependencies


Installation

1. Install the package

This will:

2. macOS: Install WeasyPrint system libraries

Required for HTML, Markdown, TXT, CSV, RTF, EPUB, and ZIP conversion on macOS. WeasyPrint needs Pango, Cairo, and GLib.

The package sets DYLD_LIBRARY_PATH automatically so Python can find these libraries. Without them, you may see:

Error: cannot load library 'libgobject-2.0-0'

Linux (Ubuntu/Debian):

3. Install LibreOffice (for Office formats)

Required only if you need to convert PPTX, XLSX, ODT, ODS, or ODP.

macOS:

Ubuntu/Debian:

Docker / Cloud: Use a custom image with LibreOffice and WeasyPrint deps; see Cloud & Server Deployment.


Cloud & Server Deployment

Architecture: Laravel + Python

exec() and proc_open must be enabled in PHP. Shared hosting that blocks these will not work.

Docker

Example Dockerfile for a Laravel app using pdfit:

Google Cloud Run

Tested and working. Use the Docker approach above. Set CMD php artisan serve --host=0.0.0.0 --port=${PORT}. First conversion may take 60–90s while uv fetches Python and deps; later ones are faster.

Azure

Environment Works? Notes
Azure VM Install uv, LibreOffice, and WeasyPrint deps via apt; add uv to PATH
Azure Container Apps / AKS Use a custom Docker image (same pattern as Cloud Run)
Azure App Service (Linux) Use a custom Docker image with the required packages
Restricted hosting If exec() is disabled or you cannot install system packages, pdfit will not run

Summary: What Must Be on the Server

Component In package? On server?
PHP code, convert.py Via Composer (vendor/veoksha/pdfit)
uv Yes — install in image/VM or let Composer post-install add it
Python + pip deps Fetched by uv at first run
LibreOffice Yes — for Office formats
Pango, Cairo, etc. Yes — for HTML/MD/TXT/CSV/RTF

Usage

Basic conversion

Dependency injection

Batch conversion

With Laravel Storage


Configuration

Publish the config file:

config/converter.php:

Option Default Description
uv_path null Path to uv binary. null = auto-detect
timeout 120 Max seconds per conversion

Environment variables:


Health check

Checks that uv and the Python script are available. Use this after deploy or when troubleshooting.


How It Works

Architecture

Conversion engines

Engine Formats System dependency
weasyprint html, md, txt, csv macOS: Homebrew; Linux: apt — see Installation
pypandoc docx, rtf, epub None (bundles Pandoc)
Pillow png, jpg, gif, etc. None
LibreOffice pptx, xlsx, odt, ods, odp Must be installed — see Installation

Why uv?


File structure


Troubleshooting

"uv not found"

Install manually:

Ensure ~/.local/bin is in your PATH.

"LibreOffice not found" (for PPTX/XLSX/ODT)

Install LibreOffice and add it to PATH (see Installation).

"cannot load library 'libgobject-2.0-0'" (macOS)

Install WeasyPrint's system dependencies: brew install pango cairo gdk-pixbuf libffi glib. See Installation.

Conversion fails silently

Shared hosting

Most shared hosts restrict exec() and installing binaries. Use a VPS, cloud VM, or Docker for reliable conversions.


FAQ

Can I use Pdfit on Azure or Google Cloud?

Yes. Use a Docker image with LibreOffice and WeasyPrint deps. Tested on Google Cloud Run. See Cloud & Server Deployment.

Does Pdfit need an external API?

No. Pdfit runs locally on your server. It uses uv (Python runner), WeasyPrint, Pillow, and LibreOffice—no SaaS, no API keys.

How do I convert Word DOCX to PDF in Laravel?

Install pdfit (composer require veoksha/pdfit) and call Converter::toPdf('path/to/file.docx'). LibreOffice must be installed for Office formats.

Does Pdfit work on macOS?

Yes. Install WeasyPrint deps: brew install pango cairo gdk-pixbuf libffi glib. The package sets DYLD_LIBRARY_PATH automatically.

What formats does Pdfit support?

Office (DOCX, XLSX, PPTX, ODT), images (PNG, JPG, etc.), web (HTML, Markdown, TXT, CSV, RTF), EPUB, and ZIP (merged PDF).


Author

Mohit Anand — Developer of Pdfit
Contact: [email protected] | [email protected]


License

MIT


All versions of pdfit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
symfony/process Version ^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package veoksha/pdfit contains the following files

Loading the files please wait ...