Commit 9d55050
authored
fix(pdf-server): render page before O(numPages) annotation scans (#581)
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 4b3f625 commit 9d55050
1 file changed
Lines changed: 22 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3896 | 3896 | | |
3897 | 3897 | | |
3898 | 3898 | | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
3899 | 3903 | | |
3900 | 3904 | | |
3901 | 3905 | | |
3902 | 3906 | | |
3903 | 3907 | | |
| 3908 | + | |
3904 | 3909 | | |
3905 | 3910 | | |
3906 | 3911 | | |
| |||
4103 | 4108 | | |
4104 | 4109 | | |
4105 | 4110 | | |
4106 | | - | |
4107 | | - | |
4108 | | - | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
4109 | 4123 | | |
4110 | 4124 | | |
4111 | 4125 | | |
| |||
4118 | 4132 | | |
4119 | 4133 | | |
4120 | 4134 | | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
4121 | 4138 | | |
4122 | | - | |
4123 | | - | |
4124 | | - | |
4125 | | - | |
4126 | | - | |
4127 | | - | |
4128 | | - | |
| 4139 | + | |
| 4140 | + | |
4129 | 4141 | | |
4130 | 4142 | | |
4131 | 4143 | | |
| |||
0 commit comments