Open the thumbnail pane in Vue PDF Viewer control
28 Feb 20266 minutes to read
The PDF Viewer exposes a openThumbnailPane() API to open the thumbnail pane from application code. Use this API when the UI needs to show the thumbnail pane in response to user actions or programmatic workflows.
Follow these steps to open the thumbnail pane from application code.
Step 1: Create a basic PDF Viewer sample using the getting started guide.
Step 2: Use the code snippet below to open the thumbnail pane.
<template>
<div id="app">
<button v-on:click="onSplitterResize">Open ThumbnailPanel</button>
<ejs-pdfviewer id="pdfViewer" ref="pdfviewer" :documentPath="documentPath">
</ejs-pdfviewer>
</div>
</template>
<script setup>
import {
PdfViewerComponent as EjsPdfviewer, Toolbar, Magnification, Navigation,
LinkAnnotation, BookmarkView, Annotation, ThumbnailView,
Print, TextSelection, TextSearch, FormFields, FormDesigner
} from '@syncfusion/ej2-vue-pdfviewer';
import { provide, ref } from 'vue';
const pdfviewer = ref(null);
const documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, Annotation,
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner])
const onSplitterResize = function () {
const viewer = pdfviewer.value.ej2Instances;
viewer.updateViewerContainer();
viewer.thumbnailViewModule.openThumbnailPane();
debugger;
}
</script><template>
<div id="app">
<button v-on:click="onSplitterResize">Open ThumbnailPanel</button>
<ejs-pdfviewer id="pdfViewer" ref="pdfviewer" :documentPath="documentPath">
</ejs-pdfviewer>
</div>
</template>
<script>
import {
PdfViewerComponent, Toolbar, Magnification, Navigation,
LinkAnnotation, BookmarkView, Annotation, ThumbnailView,
Print, TextSelection, TextSearch, FormFields, FormDesigner
} from '@syncfusion/ej2-vue-pdfviewer';
export default {
name: "App",
components: {
"ejs-pdfviewer": PdfViewerComponent
},
data() {
return {
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",
};
},
provide: {
PdfViewer: [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, Annotation,
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner]
},
methods: {
onSplitterResize: function () {
const viewer = this.$refs.pdfviewer.ej2Instances;
viewer.updateViewerContainer();
viewer.thumbnailViewModule.openThumbnailPane();
debugger;
},
}
}
</script><template>
<div id="app">
<button v-on:click="onSplitterResize">Open ThumbnailPanel</button>
<ejs-pdfviewer id="pdfViewer" ref="pdfviewer" :documentPath="documentPath" :serviceUrl="serviceUrl">
</ejs-pdfviewer>
</div>
</template>
<script setup>
import {
PdfViewerComponent as EjsPdfviewer, Toolbar, Magnification, Navigation,
LinkAnnotation, BookmarkView, Annotation, ThumbnailView,
Print, TextSelection, TextSearch, FormFields, FormDesigner
} from '@syncfusion/ej2-vue-pdfviewer';
import { provide, ref } from 'vue';
const pdfviewer = ref(null);
const serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer";
const documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, Annotation,
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner])
const onSplitterResize = function () {
const viewer = pdfviewer.value.ej2Instances;
viewer.updateViewerContainer();
viewer.thumbnailViewModule.openThumbnailPane();
debugger;
}
</script><template>
<div id="app">
<button v-on:click="onSplitterResize">Open ThumbnailPanel</button>
<ejs-pdfviewer id="pdfViewer" ref="pdfviewer" :documentPath="documentPath" :serviceUrl="serviceUrl">
</ejs-pdfviewer>
</div>
</template>
<script>
import {
PdfViewerComponent, Toolbar, Magnification, Navigation,
LinkAnnotation, BookmarkView, Annotation, ThumbnailView,
Print, TextSelection, TextSearch, FormFields, FormDesigner
} from '@syncfusion/ej2-vue-pdfviewer';
export default {
name: "App",
components: {
"ejs-pdfviewer": PdfViewerComponent
},
data() {
return {
serviceUrl: "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer",
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
};
},
provide: {
PdfViewer: [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, Annotation,
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner]
},
methods: {
onSplitterResize: function () {
const viewer = this.$refs.pdfviewer.ej2Instances;
viewer.updateViewerContainer();
viewer.thumbnailViewModule.openThumbnailPane();
debugger;
},
}
}
</script>Find the Sample how to open thumbnail