I used window.print() to print the content in modal, i want to print without the page…
Jump to turn (7)
- 1I used window.print() to print the content in modal, i want to print without the
- 2ok but where i will add page-content, this angular pages consists of many compon
- 3how make the form dialog take full print page dimensions
- 4why when i use win.document.write() i lost my bootstrap classes
- 5what the solution by using angular
- 6i want to print the form in popup modal in template , when i use the window.writ
- 7make the form take the full width and height of print page
- User
I used window.print() to print the content in modal, i want to print without the page behind the modal
- Assistant
To print the content inside the modal without including the page behind it, you can hide the unwanted elements before calling
window.print(), and then revert the changes afterwards.Here's an example using JavaScript:
javascriptfunction printModalContent() { // Hide the page content behind the modal var pageContent = document.getElementById('page-content'); pageContent.style.display = 'none'; // Print the modal content window.print(); // Revert the changes and show the page content again pageContent.style.display = 'block'; }