Javascript to email pdf form

A tiny javascript library to help javascript to email pdf form from the web. PDF files directly within our apps, without leaving the interface, and no use of embeds. These reports are sent back as PDF files. There is no need to open these files before printing them.

PDF files must be served from the same domain as your app is hosted under. There is an open bug in Mozilla’s website about this. PDF file into a new tab. The element can be of any tag, as long it has a unique id. This can be useful when you have multiple images on the screen, using a low resolution version of the images. When users try to print the selected image, you can pass the high resolution url to Print.

In your javascript, pass the highest resolution image url to Print. This is useful when printing high resolution images that are not yet loaded, like the example above. To print multiple images together, we can pass an array of images. We have the following data set in our javascript code. We can pass it to Print. Getting Started First we need to include the Print. If you will use the modal feature, also include Print.

When writing your javascript code, remember that the library occupies a global variable of printJS. There are four print document types available: ‘pdf’, ‘html’, ‘image’ and ‘json’. Document source: pdf or image url, html element id or json data object. Optional header to be used with HTML, Image or JSON printing.

It will be placed on the top of the page. Optional header style to be applied to the header text. Many people would recommend this to be around 600px. We tested many prints with 800 and it fits well for us. Typeface used when printing HTML or JSON. Font size used when printing HTML or JSON.