Jump to content

regarding If in PHP?


divadiva

Recommended Posts

Experts,

 

I am trying to use an if statement.Actually, some of the pdf files which I am using is password protected .

 

I want to put an "if" statement in this scenario .If configurtaion_file(pdf) is password protected,then simply use:

 

$pdf->Write($lh,$apath . $d_row['configuration_file'],$apath . $d_row['configuration_file']);

 


If it is not password protected pdf file then use 

$pdf->Ln() ;
$pdf->Ln() ;
$pdf->Ln() ;
$pagecount = $pdf->setSourceFile('../files/'.$d_row['configuration_file']); 
for($fpdipageindex=1; $fpdipageindex<=$pagecount; $fpdipageindex++)
{				
$tplidx = $pdf->importPage($fpdipageindex);					
$pdf->addPage(); 	
$pdf->useTemplate($tplidx, 20, 30, 150); 
}

 

Here is my full code:

 

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']);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont($ft,'',$fs);
$pdf->Ln() ;
$pdf->Ln() ;

$pdf->Ln() ;
$pdf->Ln() ;
$pdf->Ln() ;
$pagecount = $pdf->setSourceFile('../files/'.$d_row['configuration_file']); 
for($fpdipageindex=1; $fpdipageindex<=$pagecount; $fpdipageindex++)
{				
$tplidx = $pdf->importPage($fpdipageindex);					
$pdf->addPage(); 	
$pdf->useTemplate($tplidx, 20, 30, 150); 
}
}
}


 

 

Link to comment
https://forums.phpfreaks.com/topic/144824-regarding-if-in-php/
Share on other sites

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.