Jump to content

Using Fdpf in php


divadiva

Recommended Posts

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

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.