我想在pdf文档中显示这一变数。 但它造成错误: Pdf 档案不以%开始
A.php it contains my form . By using post i am sending values to other 印本 Where 印本 generates a pdf file with a specific format .
A.php
<form class="mid" action="印本" method="post">
<input type="hidden" id="cname" name="cname" value="<?php echo $c_n[0]; ?>"/>
<input type="submit" id="but" value="Print Challan"/>
</form>
印本
<?php
$c_n = $_POST[ cname ];
require( fpdf.php );
class PDF extends FPDF
{
function Header()
{
$this->Image( image.jpg ,5,5,200);
$this->Ln(20);
}
//Page footer
function Footer()
{
$this->SetFont( Arial , I ,8);
$this->Image( image1.jpeg ,5,275,200);
$this->SetXY(5, 284);
$this->Cell(0,5, This is a system generated ,0,2, C );
$this->Cell(0,5, Page .$this->PageNo(). /{nb} ,0,0, C );
}
}
//Instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont( Times , B ,15);
$pdf->SetXY(5,42);
$pdf->Cell(190,10, Challan , 0,0, C );
$pdf->SetXY(5,52);
$pdf->SetFont( Times , B ,12);
$pdf->Cell(150,18, Name :- , 1,0, L );
$pdf->Cell(15,0, $c_n , 0,0, L );
$pdf->SetXY(155,52);
$pdf->Cell(50,9, Challan No. :- , 1,2, L );
$pdf->Cell(50,9, Date :- , 1,0, L );
$pdf->SetXY(5,70);
$pdf->Cell(15,15, Sno , 1,0, C );
$pdf->Cell(35,15, Type , 1,0, C );
$pdf->Cell(45,15, Make , 1,0, C );
$pdf->Cell(45,15, Model , 1,0, C );
$pdf->Cell(45,15, Serial No. , 1,0, C );
$pdf->Cell(15,15, Qty , 1,0, C );
$pdf->SetXY(5,85);
$pdf->SetFont( Times , ,12);
$pdf->Cell(15,165, , 1,0, L );
$pdf->Cell(35,165, , 1,0, L );
$pdf->Cell(45,165, , 1,0, L );
$pdf->Cell(45,165, , 1,0, L );
$pdf->Cell(45,165,, 1,0, L );
$pdf->Cell(170,165, , 1,0, L );
$pdf->Cell(15,165, , 1,0, L );
$pdf->SetXY(5,245);
$pdf->SetFont( Times , B ,12);
$pdf->Cell(35,20, Reciever Name :- , 0,0, L );
$pdf->SetXY(125,245);
$pdf->Cell(35,20, Reciever Signature :- , 0,0, L );
$pdf->Output();
?>
原文: 档案从%开始