dever 3 years ago
parent
commit
a20af8b3ec
1 changed files with 19 additions and 1 deletions
  1. 19 1
      lib/Core.php

+ 19 - 1
lib/Core.php

@@ -12,7 +12,9 @@ class Core
         $this->pdf = new Pdf($page, $size, $type);
         $this->pdf->SetCreator('dever'); 
         $this->pdf->SetAuthor('dever'); 
-        $this->pdf->SetFont('stsongstdlight', '', 10); 
+        $this->pdf->SetFont('stsongstdlight', '', 10);
+        $this->pdf->setHeaderFont(Array('stsongstdlight', '', '10')); 
+        $this->pdf->setFooterFont(Array('stsongstdlight', '', '8'));  
         # 删除预定义的打印 页眉/页尾
         $this->pdf->setPrintHeader(false);
         $this->pdf->setPrintFooter(false);
@@ -41,6 +43,22 @@ class Pdf extends \TCPDF
         return $this;
     }
 
+    # 段落
+    public function content($name, $content, $size = 15)
+    {
+        if ($name) {
+            $this->br(1, 1);
+            $this->font($size, 'B');
+            $this->left($name, 100);
+            $this->br();
+        }
+        
+        $this->font($size, '');
+        $this->mleft($content);
+
+        return $this;
+    }
+
      /*设置单行单元格:
        W:设置单元格的宽
        H:设置单元格的高