divadiva Posted January 29, 2009 Share Posted January 29, 2009 Experts, I am trying to attach a pre-defined PDF to a PDF file generated at runtimeThe code which I have is using Fpdf.I have read that fpdi might serve the purpose. But I am unable to find any valuable .Experts please sugegst. Here is the code I have so far: <% include('fpdf.inc'); // settings $fs = 9 ; $lh = 3.5 ; $ft = 'Arial'; $pdf=new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $tmp=new PDF(); $tmp->AddPage() foreach($tb as $tx){ if($tx[9]=='item'){ $string = "SELECT * FROM `inventory` WHERE inventory.inventory_id = '" . $tx[10] . "' LIMIT 1"; $query = mysql_query("$string"); if(mysql_num_rows($query)) { $d_row = mysql_fetch_array($query); $pdf->AddPage(); $pdf->SetFont($ft,'B',$fs); $pdf->Cell(120,4,'Specification Details',0,1); $head = $tx[3]; if($tx[4]) { $head .= ' - ' . $tx[4] ; } $pdf->SetFillColor(213,234,249); $pdf->SetFont($ft,'B',$fs+3); $pdf->Ln(); $pdf->Cell(190,6,$head,1,1,'C',1); $pdf->Ln(); $pdf->SetFont($ft,'B',$fs); $pdf->Cell(190,6,dpdf($d_row['description']),0,1,'C',0); $pdf->Ln(); $yp=$pdf->GetY() ; // configuration /* if( strlen($d_row['configuration'])>2 || $d_row['configuration_file']) { $pdf->SetFont($ft,'B',$fs); $pdf->Write($lh,'Configuration'); $pdf->Ln() ; $pdf->Ln() ; $pdf->SetFont($ft,'',$fs); if(strlen($d_row['configuration'])>2) { $pdf->Write($lh,dpdf($d_row['configuration'])); $pdf->Ln() ; $pdf->Ln() ; } if($d_row['configuration_file']) { $pdf->SetTextColor(0,0,255); $pdf->SetFont($ft,'U',$fs); $pdf->Write($lh,$apath . $d_row['configuration_file'],$apath . $d_row['configuration_file']);//[b]configurtaion_file is in pdf in the database and its file loation is in /files//[/b] $pdf->SetTextColor(0,0,0); $pdf->SetFont($ft,'',$fs); $pdf->Ln() ; $pdf->Ln() ; } } How can I concatenate pdf with the pdf created on the fly? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/143021-using-fdpf-in-php/ Share on other sites More sharing options...
Dinosoles Posted March 4, 2009 Share Posted March 4, 2009 Hi, If you check the FPDF faq's it states that it is not directly possible to concatenate PDF files, 'but it is possible to use FPDI to perform this task. Some free command-line tools also exist' Hope this helps. Link to comment https://forums.phpfreaks.com/topic/143021-using-fdpf-in-php/#findComment-776112 Share on other sites More sharing options...
trampolinejoe Posted March 4, 2009 Share Posted March 4, 2009 as a backup plan, there is one out called ezpdf I have been using it for awhile seems ok to me. Link to comment https://forums.phpfreaks.com/topic/143021-using-fdpf-in-php/#findComment-776145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.