This is an implementation of the html2pdf.js from one of the projects in awesome open source.Just add the main block in the most common part of your application while the exec block will be anywhere, however, the interface on which you want to output as pdf must be on a named container since that will be the contents in the pdf.
This is still yet the first version, more features to come in relation to generating pdf for this component.