Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $pdf = new FPDI();
- $pdf_path = $_SERVER["DOCUMENT_ROOT"] . "\files\" . md5(uniqid("")) . ".pdf";
- $path_assinado = $_SERVER["DOCUMENT_ROOT"] . "\files\" . md5(uniqid("")) . ".pdf";
- file_put_contents($pdf_path, $pdfDocument);
- $pageCount = $pdf->setSourceFile($pdf_path);
- for ($i = 1; $i <= $pageCount; $i++) {
- $pdf->AddPage();
- $page = $pdf->importPage($i);
- $pdf->useTemplate($page, 0, 0);
- }
- $info = [
- 'Name' => $certificado->getCompanyName(),
- 'Date' => date("Y.m.d H:i:s"),
- 'Reason' => 'Assinatura',
- 'ContactInfo' => 'contact',
- ];
- $pdf->setSignature($certificado->__toString(), $certificado->privateKey, $senha, '', 1, $info);
- $pdf->Output($path_assinado, "F");
- return file_get_contents($path_assinado);
Add Comment
Please, Sign In to add comment