📄 body.php
字号:
<?php
// watermark based on status
// this is the postion of the watermark before the rotate
/*
$waterMarkPositions=array("50","180");
// this is the rotate amount (todo)
$waterMarkRotate=array("45","50","180");
$pdf->watermark( $quote_status, $waterMarkPositions, $waterMarkRotate );
*/
$bottom="130";
$top="80";
// blow a bubble around the table
$Bubble=array("10",$top,"170","$bottom");
$pdf->tableWrapper($Bubble);
/* ************ Begin Table Setup ********************** */
// Each of these arrays needs to have matching keys
// "key" => "Length"
// total of columns needs to be 190 in order to fit the table
// correctly
// alignment of each column
/*
$colsAlign=array( "序号" => "L",
"产品类别" => "L",
"厂商" => "C",
"产品名称" => "R",
"产品编号" => "R",
"产品规格/型号" => "R",
"单价" => "R",
"数量" => "R",
"单位" => "R",
"金额" => "R" );
*/
$colsLabel=array( "NO" => "编号",
"Product Category" => "产品类别",
"Manufacturer" => "厂商",
"Product Name" => "产品名称",
"Product Code" => "产品编号",
"Description" => "产品规格/型号",
"Unit Price" => "单价",
"Qty" => "数量",
"Usage Unit" => "单位",
"Total" => "金额" );
$colsAlign=array( "NO" => "L",
"Product Category" => "L",
"Manufacturer" => "L",
"Product Name" => "L",
"Product Code" => "L",
"Description" => "L",
"Unit Price" => "R",
"Qty" => "C",
"Usage Unit" => "L",
"Total" => "R" );
$prodTable=array("10","60");
$cols=array( "NO" => "8",
"Product Category" => "20",
"Manufacturer" => "20",
"Product Name" => "20",
"Product Code" => "20",
"Description" => "40",
"Unit Price" => "15",
"Qty" => "10",
"Usage Unit" => "12",
"Total" => "20" );
/*
$cols=array( "Product Name" => 25,
"Description" => 80,
"Qty" => 10,
"List Price" => 25,
"Unit Price" => 25,
"Total" => 25
);
*/
$pdf->addCols( $cols,$prodTable,$bottom );
$pdf->addLineFormat( $colsAlign);
/* ************** End Table Setup *********************** */
/* ************* Begin Product Population *************** */
$ppad=3;
$y = $top+10;
for($i=0;$i<count($product_name);$i++) {
$size = $pdf->addProductLine( $y, $line[$i] );
$y += $size+$ppad;
}
/* ******************* End product population ********* */
/* ************* Begin Totals ************************** */
$t=$bottom+56;
$pad=6;
for($i=0;$i<count($total);$i++) {
$size = $pdf->addProductLine( $t, $total[$i] );
$t += $pad;
}
// These are the lines in-between the totals, remove if you want
// $x,$y,$length
$lineData=array("138",$bottom+73,"57");
$pdf->drawLine($lineData);
$lineData=array("138",$lineData[1]-$pad,"57");
$pdf->drawLine($lineData);
$lineData=array("138",$lineData[1]-$pad,"57");
$pdf->drawLine($lineData);
$lineData=array("138",$lineData[1]-$pad,"57");
$pdf->drawLine($lineData);
/* ************* End Totals *************************** */
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -