Commit 3dcefe4
committed
fix(pdf-server): imported stamp canvases cropped/2x on retina
renderPage applied devicePixelRatio via ctx.scale(dpr,dpr) instead of
page.render's transform parameter. pdf.js sizes annotationCanvasMap
backing buffers as rectW * outputScaleX * viewport.scale, and
outputScaleX is read from transform[0] (defaults 1). So on retina the
per-annotation canvas got a 1x backing while its internal setTransform
(from the SVD of the already-dpr-scaled ctx) was 2x - the appearance
rendered at 2x into a half-sized buffer, showing only the top-left
quarter.
Pass dpr via transform: [dpr,0,0,dpr,0,0] so outputScaleX matches.
Also filter AnnotationLayer.render() to Widget annotations only so it
stops creating empty pointer-events:auto sections for stamps in
#form-layer that could steal clicks from our overlays.1 parent 46df2d0 commit 3dcefe4
1 file changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3225 | 3225 | | |
3226 | 3226 | | |
3227 | 3227 | | |
3228 | | - | |
3229 | | - | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
3230 | 3237 | | |
3231 | 3238 | | |
3232 | 3239 | | |
| |||
3249 | 3256 | | |
3250 | 3257 | | |
3251 | 3258 | | |
| 3259 | + | |
3252 | 3260 | | |
3253 | 3261 | | |
3254 | 3262 | | |
| |||
3337 | 3345 | | |
3338 | 3346 | | |
3339 | 3347 | | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
3340 | 3355 | | |
3341 | | - | |
| 3356 | + | |
3342 | 3357 | | |
3343 | 3358 | | |
3344 | 3359 | | |
| |||
0 commit comments