PHPackages                             paperdoc-dev/paperdoc-lib - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. paperdoc-dev/paperdoc-lib

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

paperdoc-dev/paperdoc-lib
=========================

A zero-dependency PHP library for generating, parsing and converting documents (PDF, HTML, CSV, DOCX)

v0.3.5(2w ago)327proprietaryPHPPHP ^8.2

Since Mar 1Pushed 2w agoCompare

[ Source](https://github.com/paperdoc-dev/paperdoc-lib)[ Packagist](https://packagist.org/packages/paperdoc-dev/paperdoc-lib)[ Docs](https://paperdoc.dev)[ GitHub Sponsors](https://github.com/paperdoc)[ RSS](/packages/paperdoc-dev-paperdoc-lib/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (9)Used By (0)

Paperdoc Library
================

[](#paperdoc-library)

[![Latest Version](https://camo.githubusercontent.com/05c34c5abe56b9b1631caf4fcf79ec3fc987ff564096e1e0d2c535055600a789/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061706572646f632d6465762f7061706572646f632d6c69622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paperdoc-dev/paperdoc-lib)[![Pre-release](https://camo.githubusercontent.com/46fe11c8166d3c8f5fa57c3e56ee1c5ea16ab520ca451e4ed0459b299c2da273/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73746162696c6974792d756e737461626c652d6f72616e67653f7374796c653d666c61742d737175617265)](https://github.com/paperdoc-dev/paperdoc-lib/releases)[![PHP Version](https://camo.githubusercontent.com/0137db7634f2bfb58931a1788223a4a9136100008a2ee84e758b20b9c6ec21a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c75653f7374796c653d666c61742d737175617265)](https://www.php.net)[![License](https://camo.githubusercontent.com/dfa34253097f7d822bc4bb346e0ab6f93c11a0a036ba00ffb743c49c7b842e95/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d70726f70726965746172792d7265643f7374796c653d666c61742d737175617265)](LICENSE)[![Tests](https://camo.githubusercontent.com/6d5c5924dd90006b028137004cc3ff582b3d9b780098c73f9566afb0bd0615b3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061706572646f632d6465762f7061706572646f632d6c69622f74657374732e796d6c3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/paperdoc-dev/paperdoc-lib/actions)

> A zero-dependency PHP library for generating, parsing and converting documents — PDF, HTML, CSV, DOCX, XLSX, PPTX, Markdown and more.

---

Features
--------

[](#features)

- **Generate** documents from scratch (PDF, HTML, CSV, DOCX, XLSX, PPTX, Markdown)
- **Parse** existing documents into a unified in-memory model
- **Convert** between any supported formats in one call
- **Batch processing** — open and process multiple files at once
- **Laravel integration** — first-class ServiceProvider and Facade
- **AI-powered** features via Neuron AI (OCR, LLM extraction)
- Zero native binary dependencies — pure PHP

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.2ext-dom\*ext-mbstring\*ext-zip\*ext-zlib\***Optional (Laravel)**

PackageVersionilluminate/support^11.0 | ^12.0---

Installation
------------

[](#installation)

```
composer require paperdoc-dev/paperdoc-lib
```

### Laravel auto-discovery

[](#laravel-auto-discovery)

The `PaperdocServiceProvider` and `Paperdoc` facade are registered automatically via Laravel's package auto-discovery.

---

Quick Start
-----------

[](#quick-start)

### Standalone PHP

[](#standalone-php)

```
use Paperdoc\Support\DocumentManager;

$manager = new DocumentManager();

// Create a PDF document
$doc = $manager->create('pdf', 'My Report');
$doc->addSection()
    ->addParagraph('Hello, Paperdoc!')
    ->setBold(true);

$manager->save($doc, 'output/report.pdf');
```

### Laravel (via Facade)

[](#laravel-via-facade)

```
use Paperdoc\Facades\Paperdoc;

// Create
$doc = Paperdoc::create('docx', 'Invoice #1042');
$doc->addSection()->addParagraph('Amount due: $500');
Paperdoc::save($doc, storage_path('invoices/1042.docx'));

// Parse an existing file
$doc = Paperdoc::open('uploads/report.xlsx');

// Convert directly
Paperdoc::convert('report.docx', 'report.pdf', 'pdf');

// Render as string
$html = Paperdoc::renderAs($doc, 'html');

// Batch open
$docs = Paperdoc::openBatch([
    'file1.pdf',
    'file2.docx',
    'file3.xlsx',
]);
```

---

Supported Formats
-----------------

[](#supported-formats)

FormatParseRender/GeneratePDF✅✅HTML✅✅DOCX✅✅XLSX✅✅PPTX✅✅CSV✅✅Markdown✅✅DOC✅✅XLS✅✅PPT✅✅---

Document Model
--------------

[](#document-model)

Every format shares the same in-memory structure:

```
Document
└── Section[]
    ├── Paragraph (with TextRun[], bold, italic, font…)
    ├── Table → TableRow[] → TableCell[]
    ├── Image
    └── PageBreak

```

Styles are encapsulated in `Document/Style/` and can be applied at the paragraph, run, or section level.

---

Configuration
-------------

[](#configuration)

Publish the config (Laravel):

```
php artisan vendor:publish --tag=paperdoc-config
```

This creates `config/paperdoc.php` where you can set the default format, text styles, storage paths, and AI/OCR settings.

---

Testing
-------

[](#testing)

```
composer test
# or
./vendor/bin/phpunit
```

Integration tests live in `tests/Integration/`, unit tests in `tests/Unit/`.

---

Architecture
------------

[](#architecture)

```
src/
├── Concerns/          # Shared traits
├── Console/           # Artisan commands
├── Contracts/         # DocumentInterface, ParserInterface…
├── Document/          # Core model (Document, Section, Paragraph…)
├── Enum/              # Format enums
├── Facades/           # Laravel Facade
├── Factory/           # Document/Parser factories
├── Llm/               # AI/LLM integration (Neuron AI)
├── Ocr/               # OCR integration
├── Parsers/           # Format-specific parsers
├── Renderers/         # Format-specific renderers
├── Support/           # DocumentManager and helpers
└── PaperdocServiceProvider.php

```

---

Contributing
------------

[](#contributing)

We welcome contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for release history.

---

License
-------

[](#license)

Paperdoc Library is proprietary software. See the [LICENSE](LICENSE) file for details.
© 2024–2026 Paperdoc — [paperdoc.dev](https://paperdoc.dev)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance96

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

18d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46071ff41a6620ef4019427bf6338efb59394b4f6342e9879cef0541df4cc878?d=identicon)[AkramZerarka](/maintainers/AkramZerarka)

---

Top Contributors

[![AkramZerarka](https://avatars.githubusercontent.com/u/14928910?v=4)](https://github.com/AkramZerarka "AkramZerarka (10 commits)")

---

Tags

laravelpdfparserhtmlcsvconverterdocxwriterdocument

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paperdoc-dev-paperdoc-lib/health.svg)

```
[![Health](https://phpackages.com/badges/paperdoc-dev-paperdoc-lib/health.svg)](https://phpackages.com/packages/paperdoc-dev-paperdoc-lib)
```

###  Alternatives

[faisalman/simple-excel-php

Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats

582595.7k1](/packages/faisalman-simple-excel-php)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3674.8M15](/packages/gotenberg-gotenberg-php)[rodenastyle/stream-parser

PHP Multiformat Streaming Parser

443189.9k2](/packages/rodenastyle-stream-parser)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.0k](/packages/nilgems-laravel-textract)[mnvx/lowrapper

PHP wrapper over LibreOffice converter

129187.4k](/packages/mnvx-lowrapper)[scannerjs/scanner.js

ScannerJS: JavaScript web scan JPG PDF images from TWAIN WIA scanners in browser (Chrome, Edge, Firefox or IE)

5914.2k](/packages/scannerjs-scannerjs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
