Browse Source

debug: 添加pdf对应的html副本的保存

过卫栋 5 days ago
parent
commit
2e586d204d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Services/ExamPdfExportService.php

+ 6 - 0
app/Services/ExamPdfExportService.php

@@ -1032,6 +1032,12 @@ class ExamPdfExportService
 
         // 仅使用Chrome渲染
         $chromePdf = $this->renderWithChrome($tmpHtml);
+
+        // [DEBUG] 保存 HTML 副本用于调试
+        $debugHtmlPath = storage_path('app/debug_exam_html_' . date('YmdHis') . '.html');
+        @copy($tmpHtml, $debugHtmlPath);
+        Log::warning('ExamPdfExportService: [DEBUG] HTML副本已保存', ['path' => $debugHtmlPath]);
+
         @unlink($tmpHtml);
         return $chromePdf;
     }