Print what's on the screen

May 07, 2014

Hello everyone,

I'm trying to get my students to create a timetable for themselves using "drag and drop" and using a print button, print out the timetable for them. I tried running a js with just window.print() function, but I only get a blank page. Is there anyway I can do a "print screen" followed by "print the printscreen" function using js?

I'm using articulate storyline.

5 Replies
Rebecca Fleisch Cordeiro

Hi Padma,

What browser are you using? In the past, at least, this hasn't worked with Firefox, and some people have found it doesn't work in Chrome. Here's a thread where people commented on that.

Also, are you trying this locally or via the Internet? Because it's sometimes blocked locally. Here's a support page that includes sites where you can test via the Internet.

Perhaps that will help you to sort it out.

Jo Lamontagne

Was there any solution on this one?  I checked out the other thread as well but seems like we all stalled on it.  

 

I'm using this javascript after getting it from a forum...still no joy :( xxx

 

var is_chrome = function () { return Boolean(window.chrome); }
window.onload = function() {
if(is_chrome){
/*
* These 2 lines are here because as usual, for other browsers,
* the window is a tiny 100x100 box that the user will barely see.
* On Chrome, it needs to be big enough for the dialogue to be read
* (NB, it also includes a page preview).
*/
window.moveTo(0,0);
window.resizeTo(640, 480);

// This line causes the print dialogue to appear, as usual:
window.print();

/*
* This setTimeout isn't fired until after .print() has finished
* or the dialogue is closed/cancelled.
* It doesn't need to be a big pause, 500ms seems OK.
*/
setTimeout(function(){
window.close();
}, 500);
} else {
// For other browsers we can do things more briefly:
window.print();
window.close();
}
}

This discussion is closed. You can start a new discussion or contact Articulate Support.