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!!
69 Replies
- 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.
- ArturTrzebunia1Community Member
I believe the reason why Chrome and Firefox sometimes display a blank HTML page when invoking the window.print() function is because Storyline runs your project as a flash object on the PC/Mac. When you right click on the Flash object you can click "Print" to print that slide. So, is there a javascript command that will invoke the Print function from the Flash object's menu?
- 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?
- BJKamlerCommunity Member
I am using IE and I just tried right-clicking on the slide and it printed just the slide without the extra page. Maybe that is our only other option.
- ErikaPCommunity Member
Artur Trzebunia said:
I believe the reason why Chrome and Firefox sometimes display a blank HTML page when invoking the window.print() function is because Storyline runs your project as a flash object on the PC/Mac. When you right click on the Flash object you can click "Print" to print that slide. So, is there a javascript command that will invoke the Print function from the Flash object's menu?
I am also using Chrome and looking for the option to print from the Flash menu using a button/command. Any suggestions?- ZubeidaKudoosCommunity Member
I wasn't able to find a solution, but instead I created a button which opens a light box slide and explains to learners to right click on the slide and select the Print option...not sure if that work around is an option.
- RoseKentCommunity Member
I've been reading through these past posts as I'm also having trouble printing my results page. I'm wondering if I have a more basic issue. I've added the print results button through the Results slide options. When I click the button, a IE window opens with the title of "Results", but the screen is blank. I'm guessing maybe an IE setting needs tweaked? Using IE 9.
Related Content
- 6 months ago