← Console · หน้าหลัก
Console/ Planning/ Document Share · Export

Document Share · Export

PDF via browser print · clipboard copy-link · Web Share API with honest fallback chain · per-OS capability matrix · แปลงเป็น PDF ผ่าน browser print · คัดลอกลิงก์ · ใช้ Web Share API พร้อม fallback ที่ซื่อสัตย์ต่อความสามารถจริงของแต่ละ OS
Spec · ข้อกำหนด Live · scaffold Batch 7 · v1.0 Planning · แผน Draft A-owned

Overview · ภาพรวม

Every shelled document must be convertible to PDF and must support sharing via whatever capability the user's OS/browser actually provides. This page documents the honest implementation: we use browser window.print() for PDF, navigator.share() when available, and navigator.clipboard as an always-present fallback. We do NOT claim native integration beyond what each platform actually offers.

เอกสารทุกฉบับที่ใช้ shell ต้องแปลงเป็น PDF ได้ และต้องรองรับการแชร์ตามความสามารถของ OS/browser จริง · หน้านี้อธิบายการ implement แบบซื่อสัตย์: ใช้ window.print() สำหรับ PDF · navigator.share() เมื่อใช้ได้ · และ navigator.clipboard เป็น fallback ที่มีเสมอ · ไม่อ้างเกินว่า integrate กับ OS แบบพิเศษ

Key Point · ประเด็นสำคัญ

Print = PDF on every major OS · Share = OS native when available, copy-link otherwise · NO fake integrations.
Print = PDF ได้ทุก OS หลัก · Share = ใช้ share ของ OS เมื่อใช้ได้ · ถ้าไม่ได้จะคัดลอกลิงก์ให้แทน · ไม่แกล้งทำเป็น integrate

Summary · สรุป

Three affordances, three code paths: (1) Print/PDF via window.print() — always available, paired with a @media print stylesheet that strips the topbar, mode switch, tabs, forms and reveals all panels. (2) Share — try navigator.share({title,url}); browser shows OS-native share sheet (iOS Safari · Android Chrome · macOS Safari · some Windows browsers). (3) Fallbacknavigator.clipboard.writeText(url) or a prompt(). The shell shows a honest hint about which path is active.

Affordance 3 อย่าง · 3 code path: (1) Print/PDF ด้วย window.print() — มีทุกที่ · ใช้ร่วมกับ stylesheet @media print ที่ซ่อน topbar/โหมด/tabs/form และแสดงทุก panel (2) Share — ลอง navigator.share({title,url}) · browser แสดงหน้าต่างแชร์ของ OS (3) Fallback — คัดลอกลิงก์ผ่าน clipboard หรือ prompt · shell แสดง hint ตามจริงว่ากำลังใช้ทางไหน

PDF · ไฟล์ PDF

Every shelled page ships a @media print block inside document-shell.css that:

  • Hides topbar · mode switch · tabs · note form · stakeholder filter · ซ่อน topbar · mode · tabs · form · ตัวกรอง
  • Shows ALL .ds-tabpanel as linear sections · แสดงทุก panel เป็น section ต่อเนื่อง
  • Flips backgrounds to white and text to black for ink economy · พื้นหลังขาว · ข้อความดำ · ประหยัดหมึก
  • Preserves the identity header with title and badges · เก็บ header พร้อม title และ badges

How to save as PDF by OS / วิธีเซฟ PDF ตาม OS:

OS · BrowserAction · การทำResult · ผลลัพธ์
macOS · Safari/Chrome/Firefox⌘P → "Save as PDF"Native PDF
Windows · Edge/ChromeCtrl+P → "Microsoft Print to PDF" / "Save as PDF"Native PDF
iOS · SafariShare → Options → PDFPDF file
Android · Chrome⋮ → Share → Print → Save as PDFPDF file
Linux · Firefox/ChromeCtrl+P → "Save to File" → PDFPDF file

Capability matrix · ตารางรองรับ

Based on Web Share API support as of 2026 — documented from MDN data and platform docs. Actual behavior depends on the installed browser version.

OS / Browsernavigator.share()clipboard.writeText()Recommended path
iOS Safari 13+Use OS share sheet
Android Chrome 75+Use OS share sheet
macOS Safari 14+Use OS share sheet
macOS Chrome/Firefox✗ (varies)Fallback: copy link
Windows Edge 93+✓ (limited)Use OS share sheet
Windows Chrome/FirefoxFallback: copy link
Linux · any browser✓ (most)Fallback: copy link

If navigator.share is absent, the shell falls back to clipboard without claiming native integration. · ถ้าเบราว์เซอร์ไม่รองรับ shell จะใช้ fallback โดยไม่อ้างว่า integrate กับ OS

Fallback chain · ลำดับสำรอง

  1. Try navigator.share({title, url}) if typeof navigator.share === 'function'
  2. Else try navigator.clipboard.writeText(url) — show toast "Link copied · คัดลอกแล้ว"
  3. Else open prompt('Copy link:', url) — user selects and copies manually

No step ever claims more than what the browser actually does. · ทุกขั้นไม่อ้างเกินความสามารถจริงของเบราว์เซอร์

Honest gaps · ข้อจำกัด

  • No server-side PDF generation · no headless Chrome · ไม่มี server-side PDF
  • No custom PDF template beyond @media print · ใช้ stylesheet print เท่านั้น
  • No email delivery of PDF · ไม่ส่ง PDF ทางอีเมล
  • Web Share API varies per OS/browser — documented honestly · รองรับต่าง OS ต่าง · บอกตรงๆ
  • No file attachment in Web Share (only url+title) · แชร์ได้แค่ URL + title · ไม่ใช่ไฟล์

Checklist · รายการตรวจต่อ

  • ☐ Server-side PDF rendering (Puppeteer) — Batch 8+ · PDF ฝั่ง server
  • ☐ Shareable image preview (Open Graph) · รูป preview ตอนแชร์
  • ☐ Email delivery with PDF attachment · ส่ง PDF ทางอีเมล
  • ☐ Watermark on restricted PDF exports · ลายน้ำบน PDF ที่ถูกจำกัด
  • ☐ Track share actions in audit log · บันทึก share ใน audit

Change log · ประวัติ

DateChange · รายการ
2026-04-20v1.0 · initial scaffold · Batch 7

Notes · Requirements · โน้ต

Honest state / สถานะจริง: localStorage only · browser-scoped · not synced · เก็บเฉพาะเบราว์เซอร์นี้ · ยังไม่ sync