I have a unique dynamic webpage created with Bootstrap that needs to be printable. I am implementing media queries for styling the page when printing:
/** Custom Print Styles **/
@media print {
header,
.menu,
footer {
display: none;
}
...
...
...
}
After testing the print functionality, I encountered an issue where the last page would not print if it contained only a few lines. This problem was resolved by adding additional text to the first page to ensure there were enough lines in the document.
This is the script used for printing:
$("body").on("click", ".btn-print", function() {
window.print();
});
Attempted printing using Ctrl + P also resulted in the same issue persisting.