Good day.
Tell me how to create a button to print the contents of two or more project pages in a row.
Print button
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Re: Print button
HTML only supports printing one page at a time.
https://www.w3schools.com/jsref/met_win_print.asp
Note that this is unrelated to WWB.
https://www.w3schools.com/jsref/met_win_print.asp
Note that this is unrelated to WWB.
Re: Print button
It may be possible to set an algorithm through events in the buttons for successive calls and printing of a given list of pages
Re: Print button
Although it may be possible with custom code, there is no event which can do this. It is not a easy as you make it sound...
Re: Print button
thanks, I'll think about it
- BaconFries
-
- Posts: 5884
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Print button
Maybe this will meet your needs.
Note: I take no credit whatsoever for this. I did not write anything below. You use it "AS IS" with no help to modify it in anyway.
// Add this to your button's onclick attribute
// Replace 'page1.html' and 'page2.html' with the actual URLs of the pages you want to print
This script will open each URL in a new window, wait for the content to load, then trigger the print dialog for the user to print the page. After printing, it will automatically close the new window. Remember to replace 'page1.html' and 'page2.html' with the actual URLs of the pages you want to print. Also, ensure that pop-ups are not blocked by the browser, as this will prevent the new windows from opening.
Note: I take no credit whatsoever for this. I did not write anything below. You use it "AS IS" with no help to modify it in anyway.
Code: Select all
<script>
function printPages(url1, url2) {
var page1 = window.open(url1);
var page2 = window.open(url2);
// Check if the pages are fully loaded before printing
page1.onload = function() {
page1.print();
page1.onafterprint = function() {
page1.close(); // Close the tab after printing
};
};
page2.onload = function() {
page2.print();
page2.onafterprint = function() {
page2.close(); // Close the tab after printing
};
};
}
</script>
// Add this to your button's onclick attribute
// Replace 'page1.html' and 'page2.html' with the actual URLs of the pages you want to print
Code: Select all
<button onclick="printPages('page1.html', 'page2.html')">Print Pages</button>