Issue
I'm dealing with an ionic 5 app that was built as a web app. There's no mobile component to it.
I need to allow users to print a page. When I have a print button and associated with a function like the one below, it only prints the viewable area.
printPage() {
window.print();
}
Given the amount of content on the screen, I can tell that this document should be 2-3 pages long.
I see that there's a cordova-plugin-printer plugin, but it's meant for printing from a mobile device.
What's the proper way to get the entire DOM printed?
Solution
I recently faced a similar situation and I ended up creating an angular component in my project, which is inspired by e-ngx-print.
The only limitation is that you will have to pass a *.css file to this component for the section you want to print.
I have created a stackblitz for you, have a look and see if it's useful for you.
Answered By - Govind Singh Thakur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.