@@ -13,11 +13,11 @@ import {
1313 computed ,
1414 reactive ,
1515 watch ,
16+ defineAsyncComponent ,
1617} from ' vue' ;
1718import { NMessageProvider } from ' naive-ui' ;
1819import { storeToRefs } from ' pinia' ;
1920
20- import PdfViewer from ' ./components/PdfViewer/PdfViewer.vue' ;
2121import CommentsLayer from ' ./components/CommentsLayer/CommentsLayer.vue' ;
2222import CommentDialog from ' @superdoc/components/CommentsLayer/CommentDialog.vue' ;
2323import FloatingComments from ' @superdoc/components/CommentsLayer/FloatingComments.vue' ;
@@ -35,6 +35,9 @@ import AiLayer from './components/AiLayer/AiLayer.vue';
3535import { useSelectedText } from ' ./composables/use-selected-text' ;
3636import { useAi } from ' ./composables/use-ai' ;
3737import { useHighContrastMode } from ' ./composables/use-high-contrast-mode' ;
38+
39+ const PdfViewer = defineAsyncComponent (() => import (' ./components/PdfViewer/PdfViewer.vue' ));
40+
3841// Stores
3942const superdocStore = useSuperdocStore ();
4043const commentsStore = useCommentsStore ();
@@ -104,6 +107,8 @@ const {
104107// Hrbr Fields
105108const hrbrFieldsLayer = ref (null );
106109
110+ const pdfConfig = proxy .$superdoc .config .modules ? .pdf || {};
111+
107112const handleDocumentReady = (documentId , container ) => {
108113 const doc = getDocument (documentId);
109114 doc .isReady = true ;
@@ -622,6 +627,7 @@ watch(getFloatingComments, () => {
622627 < PdfViewer
623628 v- if = " doc.type === PDF"
624629 : document - data= " doc"
630+ : config= " pdfConfig"
625631 @selection- change= " handleSelectionChange"
626632 @ready= " handleDocumentReady"
627633 @page- loaded= " handlePageReady"
0 commit comments