Browse Source

debug: 增加pdf调试

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

+ 5 - 0
app/Services/ExamPdfExportService.php

@@ -2150,6 +2150,11 @@ class ExamPdfExportService
                 return null;
             }
 
+            // [DEBUG] 保存渲染后的 HTML 用于调试
+            $debugPath = storage_path('app/debug_render_' . date('YmdHis') . '_' . ($grading ? 'grading' : 'exam') . '.html');
+            file_put_contents($debugPath, $html);
+            Log::warning('renderCustomExamHtml: [DEBUG] HTML已保存', ['path' => $debugPath, 'length' => strlen($html)]);
+
             return $this->ensureUtf8Html($html);
 
         } catch (\Exception $e) {