import puppeteer from 'puppeteer'; export interface PDFReportData { projectTitle: string; overallScore: number; totalPossible: number; grade: string; analysisDate: string; criteria: Array<{ name: string; score: number; maxScore: number; weight: number; weightedScore: number; percentage: number; feedback: string; strengths: string[]; improvements: string[]; }>; overview: { excellentItems: number; improvementItems: number; overallPerformance: number; }; improvementSuggestions: { overallSuggestions: string; maintainStrengths: Array<{ title: string; description: string; }>; keyImprovements: Array<{ title: string; subtitle?: string; description?: string; suggestions: string[]; }>; actionPlan: Array<{ phase: string; description: string; }>; }; } export class HTMLPDFGenerator { private generateHTML(data: PDFReportData): string { return `
專案名稱:${data.projectTitle}
分析日期:${data.analysisDate}
評分項目 | 得分 | 權重 | 加權分 |
---|---|---|---|
${item.name} | ${item.score}/${item.maxScore} | ${item.weight}% | ${item.weightedScore.toFixed(1)} |
${data.improvementSuggestions.overallSuggestions}