Forum Discussion
Print button - javascript
Hi, I would like to add a button that would allow the user to print the page. It seems like the easiest way would be to add a trigger to a button to execute javascript. Unfortunately, I know nothing of javascript. Can someone help me out with what need to goes into that script box?
Thank you!!
- ChristineHendriFormer Staff
Hi Val,
Though this method isn't supported by Articulate, it might be something you'd like to try for customizing the printed results. Please note that it's for Quizmaker, but this will work for Storyline, as well.
If that doesn't help with the formatting, or isn't what you're trying to do, can you give a little more information about what you'd like to show when printing the results from your course? Or how the text is displaying when you change it to English (try to provide a screenshot, of the changes if you can)?
Thanks!
Christine
- ValCeolinCommunity Member
I think I had a problem with my English story file. I create a new one and it's working well for both languages. Thanks
- ChristineHendriFormer Staff
Hi Val,
Oh, great! Glad to hear that :)
Thanks very much for the update!
Christine
- IvanaPavcicCommunity Member
Hello there,
I was wondering if anyone in the community could help me.. I have used the javascript desribed in this post to print a certificate that will be unfortuntely printed out with the player. I would like to include a line in the javascript that says "remove the print button before printing". Condering that I know aboslutely nothing regarding java, and my google searches have turned up nothing, does anyone know the actual programming language I can include with the window.print(); command that will do this?
Thanks,
Ivana
- SteveFlowersCommunity Member
Hi Jill,
Here's something that might work for you:
This requires some custom HTML magic but will offer you flexibility to display the PDF in a Web Object. If the server isn't able to serve up PDF's this won't help. The file must be downloaded to the client to print. You could try to convert the PDF to SWF and embed on the page. Many converters will make a single swf. Some have trouble printing individual pages. The old Flashpaper from Macromedia used to handle conversion.
- MarkBlessingtonCommunity Member
I published a test file using the print screen java script. I tried to print a page from the player. Nothing happened. I think this is because Mac does not recognize the java script: window.print();
Hi Mark! I just wanted to pop in here and welcome you to E-Learning Heroes! The community should be able to assist you with your Javascript questions as that is not something that Articulate supports, but it is good to have you here.
- NancyWoinoskiSuper Hero
Mark Blessington said:
I published a test file using the print screen java script. I tried to print a page from the player. Nothing happened. I think this is because Mac does not recognize the java script: window.print();
Hi Mark - were you testing locally or from a web server or LMS? Some browsers block JavaScript when run locally. - DenizOlcayCommunity Member
I'm also getting the issue with Firefox and Chrome printing a blank page. Tried on web, doesnt work.
Works in IE, but is anyone else getting the printed window cut off on the right? Is there a way to resize the window that prints?
If there are any updates on how to make sure the slide prints in IE/Chrome/Firefox that would be great too...
- BJKamlerCommunity Member
Doug Bedinger said:
I too want to print only the slide. I tried the javascript option, and it works, but I'm getting 2 pages, not just the one with the print button. Thoughts?
I am having the same issue as Doug and I didn't see any replies or answers to this issue. I'm using the javascript window.print() and it works but prints two pages instead of one... the second page is blank except for headers and footers. We will have hundreds of people printing these certificates... I don't want to kill anymore trees than I have to. Our users are not computer savvy, so I'm afraid giving them directions to print the current page or print to file would go unheeded. Ideas, anyone?