Skip to content

witPdfViewer PDF Viewer

witPdfViewer is a PDF document viewer component based on vue-pdf-embed, provides complete PDF document browsing functionality, including page navigation, zoom, print and download operations. The component adopts modern UI design, supports loading state display and custom styles, suitable for various scenarios that need to view PDF documents online.

Usage Example

vue
<template>
  <div style="height: 600px; width: 100%;">
    <witPdfViewer
      :pdf-url="pdfUrl"
      :pdf-name="pdfName"
      :border="true"
    />
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const pdfUrl = ref('https://example.com/sample.pdf')
const pdfName = ref('Sample Document.pdf')
</script>

API

Component

Component NameDescription
witPdfViewerPDF viewer main component

Properties

Property NameTypeDefault ValueDescription
pdfUrlString''PDF document URL address
pdfNameString''PDF document filename (for download)
borderBooleanfalseWhether to show border

Methods

Method NameDescriptionParameter Type
pageZoomOutZoom in PDF document-
pageZoomInZoom out PDF document-
prevPageJump to previous page or first pageisFirst: Boolean
nextPageJump to next page or last pageisEnd: Boolean
handlePrintPrint PDF document-

湘ICP备2024070110号