Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple PDFs in Sequence #789

Open
OswaldoAranda opened this issue Jan 31, 2024 · 0 comments
Open

Multiple PDFs in Sequence #789

OswaldoAranda opened this issue Jan 31, 2024 · 0 comments

Comments

@OswaldoAranda
Copy link

Hello. I have the following scenario.

File1, which calls the GeraFile1 class

File2, which calls the GeraFile2 class

File3, which calls the GeraFile3 class

All of the above conditions work perfectly, generating PDF files.

Now, if I take File4 and in this same file I consecutively call the classes GeraFile1, GeraFile2 and GeraFile3, only GeraFile1 creates the file and I receive an exception (Too many tag closures found for [span]).

How can I generate the files in sequence?

Below is my creation code:

// GENERATE THE PDF
$content = ob_get_clean();
try {
   $dir_kits = '/app/tmp/';

   $html2pdf = new Html2Pdf('P','A4','pt', array(0, 0, 0, 0));
   $html2pdf->pdf->SetDisplayMode('real');
   $html2pdf->writeHTML($content, isset($_GET['vuehtml']));

   if($type == 'kit'){;
      //Save the PDF 
      $html2pdf->Output($dir_kits.'ASO'.$id_guia.'.pdf', 'F');
   } else {
      $html2pdf->Output('ASO '.$tipo_aso.' - '.$num_guia.' - '.$colaborador_nome.'.pdf');
   };
}
   catch(HTML2PDF_exception $e) {
   echo $e;
   exit;
}

This is the same code that is in the 3 classes and as already said, individually they work satisfactorily.

How to proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant