From 4702c7a18bf1266aabe06808a310385fb18aecbb Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Tue, 3 Sep 2024 17:25:22 +0200 Subject: [PATCH] feat(viewer): add PDF viewer Signed-off-by: Grigorii K. Shartsev --- src/talk/renderer/Viewer/Viewer.js | 6 +++ src/talk/renderer/Viewer/ViewerHandlerPdf.vue | 28 ++++++++++ .../renderer/Viewer/viewer.composables.ts | 54 +++++++++++++++++++ src/talk/renderer/Viewer/viewer.service.ts | 32 +++++++++++ 4 files changed, 120 insertions(+) create mode 100644 src/talk/renderer/Viewer/ViewerHandlerPdf.vue create mode 100644 src/talk/renderer/Viewer/viewer.composables.ts create mode 100644 src/talk/renderer/Viewer/viewer.service.ts diff --git a/src/talk/renderer/Viewer/Viewer.js b/src/talk/renderer/Viewer/Viewer.js index 13ca1bfe..228cc986 100644 --- a/src/talk/renderer/Viewer/Viewer.js +++ b/src/talk/renderer/Viewer/Viewer.js @@ -13,6 +13,7 @@ export async function createViewer() { const { default: ViewerApp } = await import('./ViewerApp.vue') const { default: ViewerHandlerImages } = await import('./ViewerHandlerImages.vue') const { default: ViewerHandlerVideos } = await import('./ViewerHandlerVideos.vue') + const { default: ViewerHandlerPdf } = await import('./ViewerHandlerPdf.vue') const Viewer = { availableHandlers: [{ @@ -44,6 +45,11 @@ export async function createViewer() { 'video/x-matroska', ], component: ViewerHandlerVideos, + }, { + id: 'pdf', + group: 'document', + mimes: ['application/pdf'], + component: ViewerHandlerPdf, }], open(...args) { diff --git a/src/talk/renderer/Viewer/ViewerHandlerPdf.vue b/src/talk/renderer/Viewer/ViewerHandlerPdf.vue new file mode 100644 index 00000000..3885d3f3 --- /dev/null +++ b/src/talk/renderer/Viewer/ViewerHandlerPdf.vue @@ -0,0 +1,28 @@ + + + + +