hrynko / vue-pdf-embed

PDF embed component for Vue 2 and Vue 3
https://npmjs.com/package/vue-pdf-embed
MIT License
740 stars 111 forks source link

Feature request: Print method #27

Closed zenflow closed 2 years ago

zenflow commented 2 years ago

vue-pdf has a public method to bring up browser's print dialog for the PDF: https://github.com/FranckFreiburger/vue-pdf#public-methods

It can be invoked simply:

methods: {
    print () {
      this.$refs.myPdfComponent.print()
    },
}

My team's project needs this feature to move away from vue-pdf which lacks support for both (1) Vue3 and (2) ES Modules / Vite.

What do you think @hrynko ? Would you review/accept a PR to implement this?

hrynko commented 2 years ago

Hi @zenflow,

This feature really makes sense, I'll try to look into it.

hrynko commented 2 years ago

There is now a print method in the version 1.1.2. It takes an optional print resolution parameter, otherwise it works just as you described.

Thanks for the request!