Skip to content

v1.3.9.2 - Server-Side Headless Chromium PDF Generation & TrueType CMap Compliance

Choose a tag to compare

@spyshow spyshow released this 13 Sep 06:53
· 70 commits to master since this release

Changes in v1.3.9.2

  • Server-Side Headless Chromium PDF Generation (1-Click Download):

    • Added authenticated endpoint GET /api/projects/[id]/pdf generating executive submittal packages in memory using Puppeteer and headless Chromium (@sparticuz/chromium on serverless Linux, local Chrome/Edge auto-detection on Windows/macOS).
    • Configured with landscape A4 dimensions, high-DPI scaling, and maxDuration = 60.
    • Stitches all 8 schedules (CoverPage, LoadSchedule, MDBSchedule, CableSchedule, BreakerSchedule, VDSchedule, ShortCircuitSchedule, BOMSchedule) with ReportHeader and standalone Base64-compiled CSS.
  • 100% Compliant TrueType /ToUnicode CMaps & Clean Text Extraction:

    • Embedded installable TrueType fonts (Arial, Consolas) with complete /ToUnicode CMaps, eliminating previous PDF parser extraction failures and (cid:XX) glyph errors in PyPDF2, pdfminer, and Adobe Acrobat.
    • Successfully verified on a 12-page submittal package with 11,393 extracted characters, 0 empty pages, and 0 (cid:XX) errors, with 100% fidelity for engineering symbols (3Φ, mm², kA).
  • PDF Print Buffer Overflow & Hidden Calculation Cell Fixes:

    • Eliminated font-outlining bezier explosion that caused printer spooler memory exhaustion on multi-page browser prints.
    • Exempted interactive calculation elements inside table cells (<TraceableCell>) from @media print { [role="button"] { display: none } }, ensuring full visibility across all printed tables.
  • Standardized Apparent Power (kVA) as Primary Engineering Metric:

    • Updated Load Calculator summary cards, Executive Cover Page, SLD diagram headers, and Excel exports to prominently feature apparent power (kVA) for transformer and generator sizing, with active power (kW) and power factor clearly displayed in subtext.
  • Quality Assurance & Verification:

    • Added unit and integration tests covering renderReportHtml and GET /api/projects/[id]/pdf.
    • Verified 100% passing test suite across all 60 test files (709 tests).
    • Verified Next.js 16 production build (next build) with 0 errors.