pdf-generation - 使用 Laravel 8 和 FPDM 从数据库中填充 PDF
问题描述
我正在尝试使用存储在我的数据库中的数据填充 PDF。我在 Homestead 上运行 laravel 8 作为我的本地机器。我已经安装了这个包:https ://github.com/codeshell/fpdm来做 PDF 工作。这是我要填写的 PDF 的链接:https ://f.hubspotusercontent00.net/hubfs/7522909/Free%20Downloads/BSS-CMS-1500-Fillable.pdf 。我正在使用的代码如下。
$claim = $this->claim->findOrFail($claimId);
$this->authorize('view', $claim);
$fields = [
'topmostSubform[0].CMS1500Form[0].PatientName[0]' => 'My name'
];
$filePath = asset('files/cms1500.pdf'); // This is correct
$pdf = new \FPDM($filePath);
$pdf->Load($fields, false);
$pdf->Merge();
return $pdf->Output();
当我运行此代码时,它给了我以下异常:
fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL
routines:tls_process_server_certificate:certificate verify failed
实例化 FPDM 类时似乎失败了。有没有人遇到过这个或修复过?
解决方案
推荐阅读
- c# - SignalR 2.1.0 preview 2 final update to 2.1.0 rc1 final 在执行 services.AddSignalR() 时抛出 FileNotFoundException
- php - 为 Nuxt + Php 应用程序定义 Procfile 的正确方法
- web-services - 通信服务器和客户端的详细信息
- c++ - HDF5 链接错误 2
- python - 如何提高groupby/apply效率
- java - 在 raspbian 中用作服务时,tcpip 连接被拒绝
- python - 使用 subprocess.call() 将参数传递给 FFMPEG
- angular - 带有 IE11 的 Angular 4 - 路由器插座和 Ng 如果出现问题
- sql - 如何在 Transact-SQL 中向具有行号的表中插入记录?
- android - C++ 中的结构数组(Rad Studio 10.1 - 适用于 Android 的应用程序)