Perhaps in your case it will be more convenient to create a pdf template of the document using php, generate it on the server.
You can use the FPDF library.
Official documentation
Its functionality should be enough to create a fairly complex template, an example of how its code looks like:
require('fpdf.php'); class PDF extends FPDF { function Header() { $this->Image('logo.png',10,8,33); $this->SetFont('Helvetica','B',15); $this->SetXY(50, 10); $this->Cell(0,10,'This is a header',1,0,'C'); } function Footer() { $this->SetXY(100,-15); $this->SetFont('Helvetica','I',10); $this->Write (5, 'This is a footer'); } } $pdf=new PDF(); $pdf->AddPage(); $pdf->Output('example2.pdf','D');
PDFLib is also there - but it is paid.
Here is an example of code that allows you to put a picture on the background and impose the desired inscription:
$name = "Vasilyy Popov"; $pdf =""; $pdf=new FPDF('P', 'pt', array(<PageHeight>, <PageWidth>)); $pdf->AddPage(); $pdf->Image('background-image.jpg', 0, 0, <ImageHeight>, <ImageWidth>); $pdf->SetFont('Arial', 'B', 23); $pdf->Text(<TextPositionFromLeft>, <TextPositionFromTop>, $name); $pdf->Output('pdfSert.pdf','D');