All Projects → cangelis → php-pdf

cangelis / php-pdf

Licence: MIT License
Yet another HTML to PDF Converter based on wkhtmltopdf

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-pdf

wkhtmltopdf
Generate and return PDFs from Vapor views
Stars: ✭ 53 (+6%)
Mutual labels:  wkhtmltopdf
dotnet-eud
DevExpress .NET Controls End-User Documentation
Stars: ✭ 50 (+0%)
Mutual labels:  wkhtmltopdf
wkhtmltopdf-flask-aas
Wkhtmltopdf Flask As a Service
Stars: ✭ 17 (-66%)
Mutual labels:  wkhtmltopdf
django-invoices
Create invoices using django
Stars: ✭ 28 (-44%)
Mutual labels:  wkhtmltopdf
wkhtmltopdf-aws-lambda-layer
AWS Lambda Layer for wkhtmltopdf
Stars: ✭ 62 (+24%)
Mutual labels:  wkhtmltopdf
mdconv
A CLI markdown converter written in Go, that does not depend on LaTeX.
Stars: ✭ 42 (-16%)
Mutual labels:  wkhtmltopdf
Gotenberg
A Docker-powered stateless API for PDF files.
Stars: ✭ 3,272 (+6444%)
Mutual labels:  wkhtmltopdf
magento2-module-pdf
Magento 2 Module for creating PDF's based on wkhtmltopdf
Stars: ✭ 55 (+10%)
Mutual labels:  wkhtmltopdf
imprenta
An AWS lambda in python 3 that generates PDF files from HTML using jinja, pdfkit and wkhtmltopdf.
Stars: ✭ 18 (-64%)
Mutual labels:  wkhtmltopdf
docker-alpine-wkhtmltopdf
wkhtmltopdf alpine docker container with headless qt patches
Stars: ✭ 150 (+200%)
Mutual labels:  wkhtmltopdf
HtmlToPdfImage
transform html to pdf/image ,base on wkhtmltox and dotnet core 2.0
Stars: ✭ 16 (-68%)
Mutual labels:  wkhtmltopdf
bookjs-eazy
web print / html to pdf so eazy ,HTML自动分页插件。用于生成PDF,前端WEB打印生成PDF或后端wkhtmltopdf、chrome headless生成
Stars: ✭ 99 (+98%)
Mutual labels:  wkhtmltopdf
pydf
PDF generation in python using wkhtmltopdf for heroku and docker
Stars: ✭ 68 (+36%)
Mutual labels:  wkhtmltopdf
api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (-16%)
Mutual labels:  wkhtmltopdf
wkhtmltopdf-binary-edge
this is forked from tolgap/wkhtmltopdf-binary .
Stars: ✭ 70 (+40%)
Mutual labels:  wkhtmltopdf
wkhtmltopdf-crystal
Crystal C bindings and wrapper for libwkhtmltox library
Stars: ✭ 21 (-58%)
Mutual labels:  wkhtmltopdf
automation-report
Automation report是一款可以解决很多行业领域中设涉及到报告生成的需求,本项目最开始的初衷是为公司内部简化人工流程的一个环节,主要实现目的是将实验室检测得出的下机数据结果与对应的报告模版批量结合生成报告(.pdf)。
Stars: ✭ 13 (-74%)
Mutual labels:  wkhtmltopdf
python-pdfkit-example
python-pdfkit HTML TO PDF Example
Stars: ✭ 18 (-64%)
Mutual labels:  wkhtmltopdf
docker-symfony
Docker Symfony (PHP-FPM - NGINX - MySQL - MailHog - Redis - RabbitMQ)
Stars: ✭ 32 (-36%)
Mutual labels:  wkhtmltopdf
odoo-11.0-windows-installation
Install odoo-11.0 from source on Windows
Stars: ✭ 34 (-32%)
Mutual labels:  wkhtmltopdf

HTML to PDF Converter based on wkhtmltopdf for PHP

This is a yet another html to pdf converter for php. This package uses wkhtmltopdf as a third-party tool so proc_*() functions have to be enabled in your php configurations and wkhtmltopdf tool should be installed in your machine (You can download it from here).

Installation

Add this to your composer.json

{
    "require": {
        "cangelis/pdf": "2.2.*"
    }
}

and run composer.phar update

Some examples

$pdf = new CanGelis\PDF\PDF('/usr/bin/wkhtmltopdf');

echo $pdf->loadHTML('<b>Hello World</b>')->get();

echo $pdf->loadURL('http://www.laravel.com')->grayscale()->pageSize('A3')->orientation('Landscape')->get();

echo $pdf->loadHTMLFile('/home/can/index.html')->lowquality()->pageSize('A2')->get();

## Saving the output

php-pdf uses League\Flysystem to save the file to the local or remote filesystems.

Usage

$pdfObject->save(string $filename, League\Flysystem\AdapterInterface $adapter, $overwrite)

filename: the name of the file you want to save with

adapter: FlySystem Adapter

overwrite: If set to true and the file exists it will be overwritten, otherwise an Exception will be thrown.

Examples

// Save the pdf to the local file system
$pdf->loadHTML('<b>Hello World</b>')
    ->save("invoice.pdf", new League\Flysystem\Adapter\Local(__DIR__.'/path/to/root'));

// Save to AWS S3
$client = S3Client::factory([
    'key'    => '[your key]',
    'secret' => '[your secret]',
]);
$pdf->loadHTML('<b>Hello World</b>')
    ->save("invoice.pdf", new League\Flysystem\Adapter\AwsS3($client, 'bucket-name', 'optional-prefix'));

// Save to FTP
$ftpConf = [
    'host' => 'ftp.example.com',
    'username' => 'username',
    'password' => 'password',

    /** optional config settings */
    'port' => 21,
    'root' => '/path/to/root',
    'passive' => true,
    'ssl' => true,
    'timeout' => 30,
];
$pdf->loadHTML('<b>Hello World</b>')
    ->save("invoice.pdf", new League\Flysystem\Adapter\Ftp($ftpConf));

// Save to the multiple locations and echo to the screen
echo $pdf->loadHTML('<b>Hello World</b>')
        ->save("invoice.pdf", new League\Flysystem\Adapter\Ftp($ftpConf))
        ->save("invoice.pdf", new League\Flysystem\Adapter\AwsS3($client, 'bucket-name', 'optional-prefix'))
        ->save("invoice.pdf", new League\Flysystem\Adapter\Local(__DIR__.'/path/to/root'))
        ->get();

Please see all the available adapters on the League\Flysystem's documentation

Documentation

You can see all the available methods in the full documentation file

Contribution

Feel free to contribute!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].