diff --git a/client/src/services/storageManager.ts b/client/src/services/storageManager.ts index 9dd67a2e6d6..1aca28f2f01 100644 --- a/client/src/services/storageManager.ts +++ b/client/src/services/storageManager.ts @@ -171,7 +171,7 @@ export class StorageManager { confirmBeforeQuit: data.confirmBeforeQuit !== undefined ? data.confirmBeforeQuit : StorageManager.DEFAULT_CONFIG.confirmBeforeQuit, meteredConnection: data.meteredConnection !== undefined ? data.synchroWifiOnly : StorageManager.DEFAULT_CONFIG.meteredConnection, unsyncFiles: data.unsyncFiles !== undefined ? data.unsyncFiles : StorageManager.DEFAULT_CONFIG.unsyncFiles, - skipViewers: true, // data.skipViewers !== undefined ? data.skipViewers : StorageManager.DEFAULT_CONFIG.skipViewers, + skipViewers: false, // data.skipViewers !== undefined ? data.skipViewers : StorageManager.DEFAULT_CONFIG.skipViewers, }; return config; } diff --git a/client/src/views/viewers/DocumentViewer.vue b/client/src/views/viewers/DocumentViewer.vue index 894dadc390a..b54efb2d077 100644 --- a/client/src/views/viewers/DocumentViewer.vue +++ b/client/src/views/viewers/DocumentViewer.vue @@ -29,10 +29,34 @@ const htmlContent = ref(''); onMounted(async () => { loading.value = true; - const result = await mammoth.convertToHtml({ arrayBuffer: props.contentInfo.data.buffer }); + const result = await mammoth.convertToHtml({ + arrayBuffer: props.contentInfo.data.buffer, + }, { + styleMap: [ + "br[type='page'] => hr.page-break", + ], + }); + const pattern = '
'; + const pages = result.value.split(pattern); + pages.map((page, index) => { + pages[index] = `
${page}
`; + }); + result.value = pages.join(pattern); htmlContent.value = result.value; loading.value = false; }); - +