ctbuh/wkhtmltopdf-api-php-client

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
There is no license information available for the latest version (v1.0.4) of this package.

v1.0.4 2019-10-01 23:17 UTC

This package is not auto-updated.

Last update: 2021-05-12 07:07:49 UTC


README

Installation

composer require ctbuh\wkhtmltopdf-api-php-client

API

  • convert($bytes, $options = array())
  • inline($bytes, $options = array(), $filename = 'document.pdf')
  • download($bytes, $options = array(), $filename = 'document.pdf')

Visual Demo

https://wkhtmltopdf.api.ctbuh.org/

Code Examples

use ctbuh\PdfApi\PdfApi;

$pdf = new Pdf();
$pdf->inline("<h1>hello world</h1>");
// script stops

$html = view('admin.membership-certificates.document', $data)->render();

$pdf = new PdfApi();
$pdf->inline($html, [
    'orientation' => 'Landscape',
    'page-size' => 'letter',
    'no-outline' => true
]);

Other PDF stuff

wget https://github.com/coherentgraphics/cpdf-binaries/raw/master/Linux-Intel-64bit/cpdf
chmod +x cpdf
sudo cp cpdf /usr/local/bin/