PHPackages                             ibnuhalimm/laravel-pdf-to-html - 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. ibnuhalimm/laravel-pdf-to-html

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

ibnuhalimm/laravel-pdf-to-html
==============================

Laravel Wrapper to Convert PDF to HTML

v1.2.1(11mo ago)011.8k↑16.7%3MITPHPPHP ^7.4|^8.0

Since Oct 8Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/ibnuhalimm/laravel-pdf-to-html)[ Packagist](https://packagist.org/packages/ibnuhalimm/laravel-pdf-to-html)[ Docs](https://github.com/ibnuhalimm/laravel-pdf-to-html)[ RSS](/packages/ibnuhalimm-laravel-pdf-to-html/feed)WikiDiscussions 1.x Synced 1mo ago

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

Laravel - PDF to HTML
=====================

[](#laravel---pdf-to-html)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a28f9c5e0b3504fdddf87ac44525d9cea7b429cd032135aad023ce57a376c9c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69626e7568616c696d6d2f6c61726176656c2d7064662d746f2d68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ibnuhalimm/laravel-pdf-to-html)[![Total Downloads](https://camo.githubusercontent.com/324128774d151fc1bcc0d861b1a0082b2592f511f10283b0467c0ec57334089b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69626e7568616c696d6d2f6c61726176656c2d7064662d746f2d68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ibnuhalimm/laravel-pdf-to-html)

Convert PDF to HTML by using [pdftohtml](https://linux.die.net/man/1/pdftohtml) on Your Laravel Apps. Special thanks to [pdf-to-text](https://github.com/spatie/pdf-to-text) ([Spatie](https://github.com/spatie)) package for inspiring this package.

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Setting Up](#setting-up)
- [Usage](#usage)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security](#security)
- [Credits](#credits)
- [License](#license)

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

[](#requirements)

Behind the scene this package leverages [pdftohtml](https://linux.die.net/man/1/pdftohtml). You can verify if the binary installed on your system by executing this command.

```
which pdftohtml
```

If it doesn't return the installed path of the binary, you can install the binary using the following command.

- Ubuntu and Debian family

```
apt-get install poppler-utils
```

- CentOS, Fedora, and RedHat family

```
yum install poppler-utils
```

- Mac using brew

```
brew install poppler
```

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

[](#installation)

You can install the package via composer:

```
composer require ibnuhalimm/laravel-pdf-to-html
```

Setting Up
----------

[](#setting-up)

Optionally, you can set the config in your `.env` file:

```
PDF_TO_HTML_PATH="/usr/bin/pdftohtml"
PDF_TO_HTML_OUTPUT_DIR="/var/www/html/app/public"
PDF_TO_HTML_INLINE_IMAGES=true

```

Usage
-----

[](#usage)

Set the file and get result

```
use Ibnuhalimm\LaravelPdfToHtml\Facades\PdfToHtml;

$sourceFile = '/path/to/your-file.pdf';
PdfToHtml::setFile($sourceFile)->result();

// It will return output file path
// e.g. : /var/www/html/storage/app/pdf-to-html/your-file.html
```

Save as the result file

```
use Ibnuhalimm\LaravelPdfToHtml\Facades\PdfToHtml;

$sourceFile = '/path/to/your-file.pdf';
PdfToHtml::setFile($sourceFile)
    ->saveAs('result-file')
    ->result();

// It will return output file path as
// e.g. : /var/www/html/storage/app/pdf-to-html/result-file.html
```

We can set config on-the-fly

```
use Ibnuhalimm\LaravelPdfToHtml\Facades\PdfToHtml;

$sourceFile = '/path/to/your-file.pdf';
PdfToHtml::setFile($sourceFile)
    ->setConfig([
        'bin_path' => '/usr/local/bin/pdftohtml',
        'output_dir' => public_path('/new-location'),
        'inline_images' => false
    ])
    ->result();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email **** instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ibnu Halim Mustofa](https://github.com/ibnuhalimm)
- [Spatie](https://github.com/spatie)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance52

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~139 days

Recently: every ~243 days

Total

8

Last Release

335d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14322078?v=4)[IBNU HALIM MUSTOFA](/maintainers/ibnuhalimm)[@ibnuhalimm](https://github.com/ibnuhalimm)

---

Top Contributors

[![ibnuhalimm](https://avatars.githubusercontent.com/u/14322078?v=4)](https://github.com/ibnuhalimm "ibnuhalimm (9 commits)")[![hamrak](https://avatars.githubusercontent.com/u/5807028?v=4)](https://github.com/hamrak "hamrak (3 commits)")[![gusdemayo](https://avatars.githubusercontent.com/u/72032719?v=4)](https://github.com/gusdemayo "gusdemayo (1 commits)")[![ibnumustofapts](https://avatars.githubusercontent.com/u/184904714?v=4)](https://github.com/ibnumustofapts "ibnumustofapts (1 commits)")

---

Tags

PDF to HTMLibnuhalimmlaravel-pdf-to-html

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ibnuhalimm-laravel-pdf-to-html/health.svg)

```
[![Health](https://phpackages.com/badges/ibnuhalimm-laravel-pdf-to-html/health.svg)](https://phpackages.com/packages/ibnuhalimm-laravel-pdf-to-html)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[ismaelw/laratex

A package for creating PDFs in Laravel using LaTeX

12730.1k](/packages/ismaelw-laratex)[rockett/weasyprint

A feature-rich Laravel wrapper for the WeasyPrint Document Factory.

28199.7k](/packages/rockett-weasyprint)[ncjoes/poppler-php

Complete, Comprehensive and Flexible PHP wrapper for Poppler-utils

4137.1k1](/packages/ncjoes-poppler-php)

PHPackages © 2026

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