ext-apps/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik f3bf1065db
fix(pdf-server): import highlight/underline/strike from existing PDFs (#592)
* fix(pdf-server): import highlight/underline/strike from existing PDFs

importPdfjsAnnotation expected nested quadPoints arrays, but pdf.js
emits a flat Float32Array (8 numbers per quad). Iterating it yielded
numbers, qp.length was undefined, rects stayed empty, and the function
returned null - so every quad-based annotation in a loaded PDF was
dropped from annotationMap and rendered only as unselectable canvas
pixels. Shipped this way in #506; not a regression.

Parse the flat array in 8-stride chunks, fall through to ann.rect if
that yields nothing. Existing tests used the (wrong) nested fixture
shape; switched them to Float32Array and added a 2-quad case + a
rect-fallback case.

* fix(pdf-server): own markup annotations in our layer, not the canvas

page.render() defaulted to AnnotationMode.ENABLE, painting every
annotation's appearance stream onto the canvas. We ALSO import them into
annotationMap and render DOM versions in #annotation-layer, so the user
saw two representations: an unclickable canvas pixel that looked right,
and our clickable DOM element that looked like our styling. Clicking the
'real' one did nothing.

Set annotationMode: DISABLE so the canvas is page-content-only and our
layer is the single source of truth for markup. Imported annotations now
behave identically to user-created ones (select/drag/delete). Form
widgets are unaffected (#form-layer via AnnotationLayer.render).
get_screenshot keeps ENABLE_STORAGE so screenshots still show
annotations.

Known trade-offs:
- Stamps with image appearance streams degrade to our text-label render
  (no rasterization yet).
- Annotation types we don't import (Ink, Polygon, Caret, ...) no longer
  ghost on the canvas - they're invisible. They were never editable
  anyway; loadBaselineAnnotations already logs them.

* Revert "fix(pdf-server): own markup annotations in our layer, not the canvas"

This reverts commit 2f989a757d3aa517fa427c7fd59b462326599bfc.
2026-04-02 10:00:53 +01:00
..
basic-host chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
basic-server-preact chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
basic-server-react chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
basic-server-solid chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
basic-server-svelte chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
basic-server-vanillajs chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
basic-server-vue chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
budget-allocator-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
cohort-heatmap-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
customer-segmentation-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
debug-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
integration-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
map-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
pdf-server fix(pdf-server): import highlight/underline/strike from existing PDFs (#592) 2026-04-02 10:00:53 +01:00
qr-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
quickstart chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
say-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
scenario-modeler-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
shadertoy-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
sheet-music-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
system-monitor-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
threejs-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
transcript-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
video-resource-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
wiki-explorer-server chore: bump ext-apps to 1.4.0 (#582) 2026-04-02 04:33:13 +01:00
run-all.ts add EXAMPLE=folder-name support for tests & basic-host (#292) 2026-01-19 20:16:37 +00:00