【发布时间】:2019-11-30 12:01:57
【问题描述】:
我有一个 Laravel 5.6.39 项目,其中包含使用这些包的有效签名解决方案:
*"codedge/laravel-fpdf": "^1.3",
"setasign/fpdi": "^2.2",
"setasign/fpdi-fpdf": "^2.2"*
但这仅适用于最后一页的固定位置,右下角。我需要实现的是:
- 阅读 PDF
- 找一个词(如签名等)
- 获取该单词的坐标
-
在已经准备好的图像插入函数中使用这些坐标。
// use the imported page and adjust the page size $pdf->useTemplate($templateId, ['adjustPageSize' => true]); if ( $pageNo == $pageCount ) { $fullname = iconv('UTF-8','ISO-8859-2',$client->name).' '.iconv('UTF-8','ISO-8859-2',$client->lastname); $pdf->Image(public_path('storage/signatures/resized/'.$signature->signature_image), 115, 255, 50, '', '', '', '', false, 400); $pdf->AddFont('Arial','','arial.php'); $pdf->SetFont('Arial'); $pdf->SetXY(115, 263); //fixed coordinates, I need X,Y for word tag $pdf->Write(10, $fullname.' '.date('d.m.Y')); }
有没有人做过类似的事情并可以提供一些建议?
我正在阅读 SetaPDF-Extractor (https://www.setasign.com/products/setapdf-extractor/details/),它可能是我需要的东西,但我需要在购买之前确定这一点。
【问题讨论】:
-
因此,请在购买之前请求 SetaPDF-Extractor 组件here 的评估版。 FPDF/FPDI 无法完成您的任务。
标签: php laravel image pdf fpdf