Phase 11: version PDF (FR-15)

- เลข version ใหม่: เว็บ-generate = v0 ฉบับตั้งต้น (ไม่มี PDF), add-in save (Start Versioning + Save & Version) = v1+ มี PDF เสมอ
- PDF ผลิตจาก Word จริงผ่าน task pane เท่านั้น (getFileAsync Pdf + runtime guard, manifest ไม่เพิ่ม requirement); capture/upload เป็น best-effort — docx ผ่านแม้ PDF ล้ม + MessageBar เตือนตาม hasPdf
- Backend: DocumentVersion.PdfObjectKey (nullable, migration AddVersionPdf) + sibling .pdf ใน bucket docx-versions · multipart part pdf (ผิด type → 400) · /download + /download-link รับ ?format=pdf (ไม่มี → 404) · presigned ฝังชื่อไฟล์ไทย + _vN (RFC 5987)
- Web: เปิดไฟล์แทน blob-download — PDF แท็บใหม่, docx ผ่าน ms-word:ofe|u| พร้อม heuristic fallback ลิงก์สำรอง (useVersionOpen, versionDownload) · ปุ่ม "เปิดใน Word" ที่หน้า success ของฟอร์มสร้างเอกสาร
- Spec v7 + CONTEXT.md + ADR 0001 + แผน docs/plans/version-pdf.md
- Automated QA: backend 68 / add-in 63 / web 55 ผ่าน · manual acceptance ผ่านบน Word for Mac (2026-09-08) รวม fidelity + track changes — ค้างเฉพาะ Windows / Word on the web

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Suphonchai Phoonsawat 2026-09-08 14:01:13 +07:00
parent 618328ffa7
commit 39d610a781
39 changed files with 1387 additions and 212 deletions

View file

@ -0,0 +1,12 @@
# ADR 0001: Version PDF ผลิตจาก Word เท่านั้น
วันที่: 2026-09-08 · สถานะ: Accepted
## Decision
Word ผ่าน add-in เป็นผู้ผลิต PDF เพียงรายเดียวเพื่อรักษา layout ของเอกสาร. PDF เป็น best-effort; บันทึก docx ได้แม้ PDF ล้ม. เว็บสร้างฉบับตั้งต้น v0 ไม่มี PDF; add-in เริ่ม v1. ไม่ backfill PDF หรือเปลี่ยนเลขข้อมูลเก่า.
## Alternatives rejected
Gotenberg/LibreOffice, Aspose, Microsoft Graph cloud และ Word Interop บน server: layout engine, ต้นทุน หรือ topology ไม่ตรงข้อตกลง.
## Consequences
v0 และ version เก่าไม่มี PDF; request มีขนาดเพิ่มขึ้น. เว็บเปิด docx ผ่าน ms-word protocol ซึ่งขึ้นกับ handler ของเครื่องผู้ใช้ จึงต้องมีดาวน์โหลดสำรอง. ตรวจฟอนต์ไทย/markup/fidelity บน Word จริง.