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 แบบพิเศษ
Print = PDF on every major OS · Share = OS native when available, copy-link otherwise · NO fake integrations.
Print = PDF ได้ทุก OS หลัก · Share = ใช้ share ของ OS เมื่อใช้ได้ · ถ้าไม่ได้จะคัดลอกลิงก์ให้แทน · ไม่แกล้งทำเป็น integrate
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) Fallback — navigator.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 ตามจริงว่ากำลังใช้ทางไหน
Every shelled page ships a @media print block inside document-shell.css that:
.ds-tabpanel as linear sections · แสดงทุก panel เป็น section ต่อเนื่องHow to save as PDF by OS / วิธีเซฟ PDF ตาม OS:
| OS · Browser | Action · การทำ | Result · ผลลัพธ์ |
|---|---|---|
| macOS · Safari/Chrome/Firefox | ⌘P → "Save as PDF" | Native PDF |
| Windows · Edge/Chrome | Ctrl+P → "Microsoft Print to PDF" / "Save as PDF" | Native PDF |
| iOS · Safari | Share → Options → PDF | PDF file |
| Android · Chrome | ⋮ → Share → Print → Save as PDF | PDF file |
| Linux · Firefox/Chrome | Ctrl+P → "Save to File" → PDF | PDF file |
The shell registers a single data-ds-action="share" button anywhere on a shelled page. Click → the shell attempts, in order:
Below the share button, a hint text (data-ds-share-support) shows the truth: "OS share sheet available" or "not available · using copy link fallback".
ใต้ปุ่มแชร์จะมี hint ที่บอกตามจริงว่า "OS share sheet ใช้ได้" หรือ "ใช้ไม่ได้ · คัดลอกลิงก์ให้แทน"
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 / Browser | navigator.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/Firefox | ✗ | ✓ | Fallback: 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
navigator.share({title, url}) if typeof navigator.share === 'function'navigator.clipboard.writeText(url) — show toast "Link copied · คัดลอกแล้ว"prompt('Copy link:', url) — user selects and copies manuallyNo step ever claims more than what the browser actually does. · ทุกขั้นไม่อ้างเกินความสามารถจริงของเบราว์เซอร์
@media print · ใช้ stylesheet print เท่านั้น| Date | Change · รายการ |
|---|---|
| 2026-04-20 | v1.0 · initial scaffold · Batch 7 |