Commit a490373
committed
fix(pdf-server): render page before O(numPages) annotation scans
PR #506 added loadBaselineAnnotations() and buildFieldNameMap() between
showViewer() and renderPage(). Both iterate every page calling
getPage()+getAnnotations(), so the viewer sat with an unsized empty
canvas for ~400ms (15-page doc, scales linearly) before painting.
Neither scan blocks the canvas — page.render() only needs canvasContext
+ viewport. renderAnnotationsForPage() reads annotationMap (graceful
empty), AnnotationLayer.render() takes cachedFieldObjects (graceful
null). So: render first, scan after, re-render to overlay annotations
+ form values. Same fix at the reload path.1 parent f987bc4 commit a490373
1 file changed
+22
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3850 | 3850 | | |
3851 | 3851 | | |
3852 | 3852 | | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
3853 | 3857 | | |
3854 | 3858 | | |
3855 | 3859 | | |
3856 | 3860 | | |
3857 | 3861 | | |
| 3862 | + | |
3858 | 3863 | | |
3859 | 3864 | | |
3860 | 3865 | | |
| |||
4057 | 4062 | | |
4058 | 4063 | | |
4059 | 4064 | | |
4060 | | - | |
4061 | | - | |
4062 | | - | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
4063 | 4077 | | |
4064 | 4078 | | |
4065 | 4079 | | |
| |||
4072 | 4086 | | |
4073 | 4087 | | |
4074 | 4088 | | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
4075 | 4092 | | |
4076 | | - | |
4077 | | - | |
4078 | | - | |
4079 | | - | |
4080 | | - | |
4081 | | - | |
4082 | | - | |
| 4093 | + | |
| 4094 | + | |
4083 | 4095 | | |
4084 | 4096 | | |
4085 | 4097 | | |
| |||
0 commit comments