plesk (centos) 上的 PDFTK

问题描述 投票:0回答:1

我尝试在 PLESK 服务器 (Centos) 上托管的 php 页面上使用 PDFTK,但出现错误...

PDFTK已与composer一起成功安装

如果我使用:

$pdf = new Pdf('form.pdf');
$result = $pdf->fillForm([
    'name'=>'test name',
    'email' => 'test email',
])
->needAppearances()
->saveAs('form_filled.pdf');

我有这个错误:

sh: pdftk: command not found

我想我在文档中找到了一个想法: 使用Plesk(onCentos),我认为你需要指出pdftk的完整路径,但我不知道如何找到它......

$pdf = new Pdf('/path/my.pdf', [
    'command' => '/some/other/path/to/pdftk',
    // or on most Windows systems:
    // 'command' => 'C:\Program Files (x86)\PDFtk\bin\pdftk.exe',
    'useExec' => true,  // May help on Windows systems if execution fails
]);

有人可以帮助我或有其他想法吗...谢谢

plesk pdftk
1个回答
0
投票

php-pdftk Composer 软件包不会为您安装 pdktk 二进制文件。您需要自行安装。来自医生

要求

  • 您的系统上必须安装并运行 pdftk 命令

https://github.com/mikehaertl/php-pdftk#requirements

© www.soinside.com 2019 - 2024. All rights reserved.