|
...
|
...
|
@@ -36,14 +36,26 @@ protected function error($message = 'error', $status = 400, $data = []) |
|
|
|
return json_encode($array, JSON_UNESCAPED_UNICODE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pdf文件添加二维码
|
|
|
|
* @param Request $request
|
|
|
|
* @return string
|
|
|
|
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
|
|
|
* @throws \setasign\Fpdi\PdfParser\Filter\FilterException
|
|
|
|
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
|
|
|
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
|
|
|
* @throws \setasign\Fpdi\PdfReader\PdfReaderException
|
|
|
|
* @author Akun
|
|
|
|
* @date 2026/03/04 10:43
|
|
|
|
*/
|
|
|
|
public function addQrToPdf(Request $request)
|
|
|
|
{
|
|
|
|
$sourceFile = $request->input('original_pdf');
|
|
|
|
if (empty($sourceFile)) {
|
|
|
|
return $this->error('原始pdf未传参');
|
|
|
|
return $this->error('原始pdf地址未知');
|
|
|
|
}
|
|
|
|
if (!file_exists($sourceFile)) {
|
|
|
|
return $this->error('原始pdf不存在');
|
|
|
|
return $this->error('原始pdf文件不存在');
|
|
|
|
}
|
|
|
|
$qrText = $request->input('qr_text');
|
|
|
|
if (empty($qrText)) {
|
...
|
...
|
|