steinbauerit/neos-headlesschrome

此包最新版本(0.0.1)没有可用的许可信息。

Neos Flow 包,用于使用无头 Chrome 打印为 PDF。

安装: 182

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:neos-package

0.0.1 2023-08-06 17:09 UTC

This package is not auto-updated.

Last update: 2024-09-16 20:36:48 UTC


README

注意:此包处于开发中!

安装

只需运行

composer require steinbauerit/neos-headlesschrome

在您的机器上安装 chromium

例如,在 alpine linux 上

apk update
apk upgrade
apk add chromium

确定您的 Chrome 安装的二进制文件位置

which chromium-browser

配置

SteinbauerIT:
  Neos:
    HeadlessChrome:
      chromeExecutable: '/usr/bin/chromium-browser'
      defaultAttributes:
        - 'disable-gpu'
        - 'no-margins'
        - 'no-sandbox'

使用方法

use SteinbauerIT\Neos\HeadlessChrome\Print2Pdf;

$print2Pdf = new Print2Pdf();
$print2Pdf->setSource($source);
$print2Pdf->setTargetDirectory($targetPath);
$print2Pdf->setAttributes(
    ['foo', 'bar']
);
$result = $print2Pdf->execute(); // Path to the printed PDF

作者