Hi there,
is it somehow possible to attach 1 or more exisiting PDF documents as a new page to a PDF that I create with your tool?
I'm looking forward to your answers,
Dominik
$html2pdf = new HTML2PDF('P','Letter','en', false, 'ISO-8859-15', array(20, 20, 20, 20));
$html2pdf->pdf->SetAuthor($User);
$html2pdf->pdf->SetTitle(‘PDF Title’);
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
//Set a temporary working file
$TMPpdffile = 'tempfile.pdf';
//Declare the PDF you want to add to it.
$PDFtoMerge = 'file_to_merge.pdf';
//Create temporary file
$html2pdf->Output($TMPpdffile, 'F');
//Declare which files you want to merge (must be in the order you want them to be displayed
$fileArray= array($TMPpdffile,$PDFtoMerge);
//Define the output filename
$outputName = 'output.pdf';
//Pre-write the command
$cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outputName ";
//Add each pdf file to the end of the command
foreach($fileArray as $file) {
$cmd .= $file." ";
}
//Execute the command
$result = shell_exec($cmd);
//Delete temp file
unlink($TMPpdffile);