Get Started
Component Registration
Register and import the Html2Pdf component in Vue applications using local imports or app-level registration, with recommended package style imports.
Local import - recommended
With <script setup>:
<script setup lang="ts">
import { Html2Pdf } from 'vue-pdf-export'
import 'vue-pdf-export/style.css'
</script>
No components registration is required.
Options API
<script lang="ts">
import { defineComponent } from 'vue'
import { Html2Pdf } from 'vue-pdf-export'
import 'vue-pdf-export/style.css'
export default defineComponent({
components: {
Html2Pdf,
},
})
</script>
Global registration
import { createApp } from 'vue'
import App from './App.vue'
import { Html2Pdf } from 'vue-pdf-export'
import 'vue-pdf-export/style.css'
const app = createApp(App)
app.component('Html2Pdf', Html2Pdf)
app.mount('#app')
Rendering Modes
Compare Canvas and selectable-text rendering in vue-pdf-export and choose between maximum browser visual fidelity and searchable, selectable PDF text.
Preview & Download
Configure vue-pdf-export for PDF preview, automatic download or combined preview and download workflows with the Html2Pdf component.
