TeamMaestro / pdf-viewer

PDF viewer web component built in StencilJS. Reusable in Angular, Ionic, React, Vue.JS, etc.
MIT License
76 stars 12 forks source link

Feature request: custom button and custom handler #16

Closed connor-odoherty closed 4 years ago

connor-odoherty commented 5 years ago

ie. Your app requires users to read and accept a PDF contract

  1. User accesses the contract page, bringing up the contract PDF with stencil-pdf-viewer
  2. In the PDF viewer, there is an additional, custom button (in this case, indicating that they are accepting the contract)
  3. When they click this button, it activates the custom handler set in the client (in this case, brings up an 'Are you sure modal?' and closes the PDF viewer upon acceptance, passing the view back to the original caller)
sean-perkins commented 4 years ago

You're defining app behavior. That type of behavior should belong in your app, not in a library/plugin. Simply prompt your confirmation prior to rendering the PDF Viewer. This adds zero overhead to this plugin and keeps all the business logic in your app's controllers.