setPdf($path)->text(); // Analizar texto para detectar anotaciones return $this->parseAnnotations($text); } public function embedAnnotations($originalPdf, $annotations) { $pdf = new PDFLib(); $pdf->begin_document('', ''); foreach($annotations as $annotation) { $this->addAnnotationToPdf($pdf, $annotation); } return $pdf->get_buffer(); } }