|
@@ -28,38 +28,60 @@ class Goods extends Core
|
|
|
# 下单pdf
|
|
|
public function pdf()
|
|
|
{
|
|
|
- Dever::apply('fpdf184/chinese', 'pdf');
|
|
|
+ Dever::apply('fpdf/chinese', 'pdf');
|
|
|
|
|
|
$pdf=new \PDF_Chinese();
|
|
|
+ $pdf->AddGBFont();
|
|
|
+ $pdf->Open();
|
|
|
+ $pdf->AddPage();
|
|
|
+ $pdf->SetFont('GB', 'B', 10);
|
|
|
+ $pdf->Cell(0, 8, $this->convert("------------------------------------------------------------------厨人易料------------------------------------------------------------------"), 0, 0, 'C');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Ln();
|
|
|
|
|
|
- $pdf->AddGBFont('simsun','宋体');
|
|
|
+ $pdf->SetFont('GB', 'B', 20);
|
|
|
+ $pdf->Cell(180, 8, $this->convert("库存清单"), 0, 0, 'C');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->SetFont('GB', 'B', 10);
|
|
|
+ $pdf->Cell(180, 8, $this->convert("门店名称:的发电机房就得开"), 0, 0);
|
|
|
|
|
|
- $pdf->AddGBFont('simhei','黑体');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(180, 8, $this->convert("制单人:23213213"), 0, 0);
|
|
|
|
|
|
- $pdf->AddGBFont('simkai','楷体_GB2312');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(180, 8, $this->convert("制单时间:23213213"), 0, 0);
|
|
|
|
|
|
- $pdf->AddGBFont('sinfang','仿宋_GB2312');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(0, 8, $this->convert("----------------------------------------------------------------------------------------------------------------------------------------------"), 0, 0);
|
|
|
|
|
|
- $pdf->Open();
|
|
|
-
|
|
|
- $pdf->AddPage();
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(150, 8, $this->convert("商品名称"), 0, 0);
|
|
|
+ $pdf->Cell(40, 8, $this->convert("数量"), 0, 0, 'R');
|
|
|
|
|
|
- $pdf->SetFont('simsun','',20);
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
|
|
|
+ $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
|
|
|
|
|
|
- $pdf->Write(10,'简体中文汉字');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(0, 8, $this->convert("----------------------------------------------------------------------------------------------------------------------------------------------"), 0, 0);
|
|
|
|
|
|
- $pdf->SetFont('simhei','',20);
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(180, 8, $this->convert("如遇任何问题请至电客服"), 0, 0, 'C');
|
|
|
|
|
|
- $pdf->Write(10,'简体中文汉字');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(180, 8, $this->convert("电话:400-123-1234"), 0, 0, 'C');
|
|
|
|
|
|
- $pdf->SetFont('simkai','',20);
|
|
|
-
|
|
|
- $pdf->Write(10,'简体中文汉字');
|
|
|
-
|
|
|
- $pdf->Write(10,'简体中文汉字');
|
|
|
+ $pdf->Ln();
|
|
|
+ $pdf->Cell(180, 8, $this->convert("周一~周五 9:00~18:00"), 0, 0, 'C');
|
|
|
|
|
|
$pdf->Output();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ private function convert($string, $to = 'GBK', $source = 'UTF-8')
|
|
|
+ {
|
|
|
+ return mb_convert_encoding($string, $to, $source);
|
|
|
+ }
|
|
|
}
|