K
K
kpb2021-06-25 10:39:04
PHP
kpb, 2021-06-25 10:39:04

How can I edit pdf files using php mpdf so that the inscriptions made by another editor do not disappear?

Good afternoon, there was a problem with editing with mpdf. There is a pdf file that was labeled with Foxit Reader, but they disappear when you try to edit this pdf

$path = 'file.pdf';
$mpdf = new \Mpdf\Mpdf(['format' => 'A4', 'orientation' => 'P', 'default_font' => 'arial']);
$mpdf->SetSourceFile($path);
$tplId = $mpdf->ImportPage(1);
$mpdf->UseTemplate($tplId);
$mpdf->Output(str_replace(['.pdf'], ['_sign.pdf'], $path), 'F');

How can this problem be solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2021-06-25
@Adamos

It is worth looking at this file with another program - maybe Foxit sculpts something of its own there, not according to the standard. At least open it in a browser, they now know how to do it.
Well, what about Arial - does mPDF have it at all? This is not Windows, there is nothing like it out of the box. It's more like DejaVuSans or FreeSans.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question