Load full pdf document in background when entering presentation mode GitOrigin-RevId: 514ef838b155a7f13f3bc12690aef45fd3f2c3fc
@@ -133,6 +133,8 @@ export default function usePresentationMode(
pdfJsWrapper.viewer.scrollMode = 3 // page
pdfJsWrapper.viewer.spreadMode = 0 // none
+ pdfJsWrapper.fetchAllData()
+
setPresentationMode(true)
}
}, [pdfJsWrapper, setScale, scale])
@@ -99,6 +99,10 @@ export default class PDFJSWrapper {
+ async fetchAllData() {
+ await this.viewer.pdfDocument?.getData()
+ }
// update the current scale value if the container size changes
updateOnResize() {
if (!this.isVisible()) {