Commit ed43fe0
committed
feat: vector viewport overhaul — fit/zoom/rotation/cursor/font cache + hybrid stamp extraction
- Layout: removed #pdf-container padding so the canvas fills the viewport
edge-to-edge; fitToViewport() no longer subtracts a 20px margin
- Centralized fit math in computeFitZoom(); fitWidth/fitPage/fitToViewport
share one helper across vector + legacy modes
- Reactive cursor (js/ui/cursor.js): single createMemo derived from app
state; tools no longer touch canvas.style.cursor (~200 lines deleted)
- Single wheel handler in navigation-events.js for zoom + pan +
page-nav-at-edges; discrete zoom steps with trackpad accumulation
- clampAndCenter() invariant: page is centered on any axis where it fits
- ResizeObserver on #pdf-container re-anchors the world point at canvas
center on layout changes (panel toggle, window resize, etc)
- Document-scoped font cache: FontRegistry keyed by global font ObjectId,
amortized across pages within a document; DocumentHandleCache in Tauri
layer keeps the parsed lopdf::Document alive across IPC commands
- Rust extract_text + extract_text_batch commands; rayon par_iter for
extract_draw_commands_batch / extract_text_spans_batch /
page_dimensions_all
- Page rotation in vector mode: open-pdf-render reads /Rotate (with
/Parent inheritance), applies the rotation matrix to draw commands,
combines with the user's per-page rotation map; cache key includes
rotation
- Hybrid stamp extraction: pdf-lib XObject path first (no annotation
bake-in), PDF.js render+crop fallback only when pdf-lib can't decode
- Annotations key off viewport.pageNum (visible) instead of doc.currentPage
(intended) so they don't flash on the wrong page during slow extracts
- updateActiveThumbnail() syncs selectedPages so the thumbnail panel
highlight follows any navigation method
- Status bar zoom +/- and input + ribbon View buttons wired to viewport
zoom helpers instead of the legacy doc.scale path
- Status bar prev/next go through goToPage() so the thumbnail tracks
- setPage() preserves zoom on same-document page changes (detects new
file via path); only fits on a genuinely new document
- Text highlights on dedicated #text-highlight-canvas with CSS
mix-blend-mode: multiply (don't hide underlying text)
- Cursor stays "grabbing" through middle-click drag (handled by the
reactive cursor system)
- Version 1.42.0 → 1.43.01 parent 96d0b68 commit ed43fe0
37 files changed
Lines changed: 2470 additions & 395 deletions
File tree
- open-pdf-render
- examples
- src
- open-pdf-studio
- js
- annotations
- core
- stores
- pdf
- loader
- solid
- components
- text
- tools
- tools
- ui
- panels
- setup
- src-tauri
- src
- styles
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
21 | 35 | | |
22 | | - | |
| 36 | + | |
23 | 37 | | |
24 | 38 | | |
25 | 39 | | |
| |||
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
36 | 54 | | |
37 | 55 | | |
38 | 56 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
42 | 73 | | |
43 | 74 | | |
44 | | - | |
45 | | - | |
| 75 | + | |
| 76 | + | |
46 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
47 | 85 | | |
48 | 86 | | |
49 | 87 | | |
| |||
68 | 106 | | |
69 | 107 | | |
70 | 108 | | |
71 | | - | |
| 109 | + | |
72 | 110 | | |
73 | 111 | | |
74 | 112 | | |
75 | 113 | | |
76 | 114 | | |
77 | | - | |
| 115 | + | |
78 | 116 | | |
79 | 117 | | |
80 | | - | |
| 118 | + | |
81 | 119 | | |
82 | 120 | | |
83 | | - | |
| 121 | + | |
84 | 122 | | |
85 | 123 | | |
86 | 124 | | |
| |||
103 | 141 | | |
104 | 142 | | |
105 | 143 | | |
106 | | - | |
| 144 | + | |
107 | 145 | | |
108 | 146 | | |
109 | | - | |
| 147 | + | |
110 | 148 | | |
111 | 149 | | |
112 | 150 | | |
113 | 151 | | |
114 | 152 | | |
115 | 153 | | |
116 | 154 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 155 | + | |
121 | 156 | | |
122 | 157 | | |
123 | 158 | | |
| |||
154 | 189 | | |
155 | 190 | | |
156 | 191 | | |
157 | | - | |
158 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
159 | 201 | | |
160 | | - | |
161 | | - | |
| 202 | + | |
| 203 | + | |
162 | 204 | | |
163 | 205 | | |
164 | 206 | | |
165 | 207 | | |
166 | 208 | | |
167 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
168 | 212 | | |
169 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
170 | 222 | | |
171 | 223 | | |
172 | 224 | | |
| |||
0 commit comments