ctbuh / wkhtmltopdf-api-php-client

此软件包最新版本(v1.0.4)没有可用的许可证信息。

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

This package is auto-updated.

Last update: 2024-08-29 05:23:22 UTC


README

安装

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')

可视化演示

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

代码示例

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
]);

其他PDF相关内容

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