To print HTML elements, in a similar way, pass in the element id and type: printJS('myElementId', 'html'). The PDFViewer supports scrolling, paging, zooming and much. It's basic usage is to call printJS() and just pass in a PDF document url: printJS('docs/PrintJS.pdf').įor image files, the idea is the same, but you need to pass a second argument: printJS('images/PrintJS.jpg', 'image'). The PDFViewer control allows your users to display PDF documents in web or hybrid mobile apps. There are four print document types available: 'pdf', 'html', 'image' and 'json'. PDF.js is a web standards-based platform for parsing and rendering Portable Document Formats (PDFs). When writing your javascript code, remember that the library occupies a global variable of printJS. If you will use the modal feature, also include Print.css on the page. When installing via npm or yarn, import the library into your project:įirst we need to include the Print.js library on the page. You can download the latest version of Print.js from the GitHub releases. JSON, HTML and Image print can receive a raw HTML header: We can customize the table header text sending an object array We can style the data grid by passing some custom css: PDF viewer can be used to display PDF documents within your app, which enables your users to preview PDF documents before printing or downloading them. This would probably come from an AJAX call to a server API: We have the following data set in our javascript code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |