πVue HTML to Paper
Vue mixin for paper printing html elements.
Demo
Install
NPM
npm install vue-html-to-paperYarn
yarn add vue-html-to-paperCDN
https://unpkg.com/vue-html-to-paper/build/vue-html-to-paper.jsUsage
main.js
import Vue from 'vue';
import VueHtmlToPaper from 'vue-html-to-paper';
const options = {
name: '_blank',
specs: [
'fullscreen=yes',
'titlebar=yes',
'scrollbars=yes'
],
styles: [
'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
'https://unpkg.com/kidlat-css/css/kidlat.css'
],
timeout: 1000, // default timeout before the print window appears
autoClose: true, // if false, the window will not close after printing
windowTitle: window.document.title, // override the window title
}
Vue.use(VueHtmlToPaper, options);
// or, using the defaults with no stylesheet
Vue.use(VueHtmlToPaper);component
With local options
Callback
Notes
FAQ
How to print in landscape
Last updated
Was this helpful?