divadiva Posted February 11, 2009 Share Posted February 11, 2009 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 More sharing options...
trq Posted February 11, 2009 Share Posted February 11, 2009 What pdf library are you using? Link to comment https://forums.phpfreaks.com/topic/144824-regarding-if-in-php/#findComment-759955 Share on other sites More sharing options...
divadiva Posted February 11, 2009 Author Share Posted February 11, 2009 FPDF Link to comment https://forums.phpfreaks.com/topic/144824-regarding-if-in-php/#findComment-759983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.