|
|
@@ -118,18 +118,18 @@ class Pdf
|
|
|
// 初始化 FPDI
|
|
|
$pdf = new Fpdi();
|
|
|
|
|
|
-// $fontRegular = WEB_PATH . "static/common/fonts/msyh.ttf";
|
|
|
-// $pdf->AddFont('msyh', '', $fontRegular, true); // 常规
|
|
|
+ $fontRegular = __DIR__."/fonts/msyh.php";
|
|
|
+ $pdf->AddFont('msyh', '', $fontRegular); // 常规
|
|
|
//
|
|
|
//// 设置默认字体
|
|
|
-// $pdf->SetFont('msyh', '', 40); // 使用常规字体
|
|
|
+ $pdf->SetFont('msyh', '', 30); // 使用常规字体
|
|
|
|
|
|
// 确保 PHP 文件编码为 UTF-8(无 BOM)
|
|
|
// $pdf->setHeaderData('', 0, '', '', [0, 0, 0], [255, 255, 255]);
|
|
|
// $pdf->setDocInfo('Creator', 'Your App', 'Title', 'Subject', 'Keywords', 'UTF-8');
|
|
|
|
|
|
- $pdf->SetFont('cid0cs', '', 30); // 使用内置中文字体
|
|
|
- $pdf->setLanguageArray(['a_meta_charset' => 'UTF-8']);
|
|
|
+// $pdf->SetFont('cid0cs', '', 30); // 使用内置中文字体
|
|
|
+// $pdf->setLanguageArray(['a_meta_charset' => 'UTF-8']);
|
|
|
|
|
|
// 加载已有 PDF
|
|
|
$pageCount = $pdf->setSourceFile($filePath);
|