Download the PHP package moinul/laravel-pdf-to-html without Composer
On this page you can find all versions of the php package moinul/laravel-pdf-to-html. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moinul/laravel-pdf-to-html
More information about moinul/laravel-pdf-to-html
Files in moinul/laravel-pdf-to-html
Package laravel-pdf-to-html
Short Description A Laravel package to convert PDF files to HTML using poppler-utils
License MIT
Informations about the package laravel-pdf-to-html
Laravel PDF to HTML Converter
A Laravel package that converts PDF files to HTML with preserved formatting and styling using poppler-utils.
Requirements
- PHP 8.2 or higher
- Laravel 7.x|8.x|9.x|10.x|11.x
pdftohtml
command-line tool (poppler-utils)
Installation
-
Install the package via Composer:
- Install the required system dependency:
For Ubuntu/Debian:
For CentOS/RHEL:
For macOS:
-
The package will automatically register its service provider in Laravel 5.5 and newer.
- Create the storage symlink if you haven't already:
Usage
Basic Usage
Example Route
Here's a complete example of a route that converts a PDF file to HTML:
Example View
Create a view file resources/views/pdf/html-output.blade.php
:
Features
- Converts PDF files to responsive HTML
- Preserves text formatting and layout
- Handles images and maintains their positions
- Includes print-friendly styles
- Responsive design for various screen sizes
- Uses the efficient
pdftohtml
command-line tool
How it Works
The package uses the pdftohtml
command-line tool from poppler-utils to convert PDF files to HTML. The conversion process:
- Takes a PDF file as input
- Converts it to HTML while preserving formatting
- Processes images and fixes their paths
- Adds responsive and print-friendly CSS
- Returns a clean, formatted HTML string
License
This package is open-sourced software licensed under the MIT license.
Support
If you encounter any issues or have questions, please create an issue on GitHub.