pdfobject-vue

Official PDFObject component for Vue 3
199,735
Install
npm install pdfobject-vue
Latest Version:0.0.5
Vue:3
License:MIT
Last Updated:Oct 30, 2025
Links: npm
Maintainer: pipwerks

pdfobject-vue

A PDFObject component for Vue 3 projects

Creates a <PdfObject> Vue component, enabling easy PDF embedding in any Vue 3 project. Pass the URL of the PDF via the url parameter (String), and any desired options via the :options (Object). Note the binding via colon :options.

Important: While PDFObject has always been spelled with capitalized PDF (because it's an acronym), the Vue component uses camelCase PdfObject. This is to align with Vue's naming convention which stipulates component names should be comprised of two words.

It's safe to use either <PdfObject> or <pdf-object>.

A full list of PDFObject options (and examples) can be found at PDFObject.com.

Assumes the PDFObject JS utility has also been installed via NPM. npm install pdfobject

Example

In your vue file, such as App.vue:

<PdfObject url="/pdf/sample.pdf" :options="{ height: '500px', pdfOpenParams: { view: 'FitV' }}" />

In main.js

import { createApp } from 'vue';
import App from './App.vue';
import PDFObjectPlugin from 'pdfobject-vue';

const app = createApp(App);
app.use(PDFObjectPlugin);
app.mount('#app');

Or to import in a single component

<script setup>
import { PdfObject } from 'pdfobject-vue';
</script>
<template>
<div>
  <PdfObject url="/pdf/sample.pdf" />
</div>
</template>

Links

PDFObject documentation https://pdfobject.com

PDFObject source code https://github.com/pipwerks/pdfobject

Test project for this plugin/component: https://github.com/pipwerks/PDFObject-Vue-Test

NPM: https://www.npmjs.com/package/pdfobject-vue

Related Packages

vue-pdf-embed

PDF embed component for Vue

7,595,565 1,044
@tato30/vue-pdf

PDF component for Vue 3

2,130,711 692
vue-pdf

vue.js pdf viewer

864,848 2,295
@teckel/vue-pdf

vue.js pdf viewer

163,440 2
pdf-viewer-vue

PDF viewer component for Vue 2 and Vue 3

103,695 23

Version History

Version Released License
0.0.5 MIT
0.0.4 MIT
0.0.3 MIT
0.0.2 MIT
0.0.1