vue-easy-printer

The Best Vue Plugin To convert Html page, Components to pdf
1,717 2
Install
npm install vue-easy-printer
Latest Version:1.0.6
Vue:2
License:MIT
Last Updated:Nov 8, 2022
Links: GitHub  ·  npm
Maintainer: loicgeek

Description

vue-easy-printer plugin help you to convert your html page to pdf. Features includes converting using the DOM elementId , print on portrait or landscape orientation , you could also print you component directly !!

How to install

npm i vue-easy-printer

Install on your Vuejs Entry Page (main.js or app.js)

import Vue from 'vue';
import VueEasyPrinter from 'vue-easy-printer';

Vue.use(VueEasyPrinter);

Usage

Once you have installed the package and registered to you Vue app , two methods are now avalable on every Component. They are $easyPrint and $easyPrintComponent .`

  1. $easyPrint

    $easyPrint(elementId,title=null,orientation='portrait',preview=false)

    elementId: the string corresponding to the id of the DOM element you would like to print. title: the string corresponding to the title of the page you are going to create. orientation: the string corresponding to the printing orientation of your page. it can be 'portrait' or 'lanscape'. The default orientation is landscape

  2. $easyPrintComponent

    $easyPrintComponent (component, propsData={},title=null, orientation = 'portrait',preview=false) component: The component you want you print into pdf. propsData: props data to pass to this component.

    In your component file you can just call :

    this.$easyPrint('myElementId','Awesome Page title','landscape')
    

    or

    import MyAwesomeComponent from './MyComponent';
    this.$easyPrintComponent(MyAwesomeComponent,{name:'loic',country:'Cameroon'});
    

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
pdfobject-vue

Official PDFObject component for Vue 3

199,735
@teckel/vue-pdf

vue.js pdf viewer

163,440 2

Version History

Version Released Vue License
1.0.6 ^2.6.10 MIT
1.0.5 ^2.6.10 MIT
1.0.4 ^2.6.10 MIT
1.0.3 ^2.6.10 MIT
1.0.2 ^2.6.10 MIT