用pdftk php填写后关闭PDF表单

问题描述

我将php-pdftk与laravel nova一起使用,在保存资源后填写表格。问题在于生成的填充pdf仍可编辑。

填充后是否可以关闭该PDF?

我已经读到,设置“ flatten”属性可以做到这一点,但这与西班牙语字符所需的needAppearances()不兼容

    $pdf = new Pdf( storage_path() . '/app/contracts/' . $this->contract_type . '.pdf',[
        'command' => 'pdftk','useExec' => true
    ]);
    $pdf->fillForm($pdf_content)
        ->needAppearances();

谢谢!

解决方法

最后,唯一的问题是,这些表单字段在pdf中具有不包含这些字符的字体。

更改该字体可以解决此问题。默认情况下,Acrobat为自定义表单设置了非常基本的字体...

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...