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!!
- 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.
- 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.
Hi Rose,
You'll also want to ensure that you're testing the published output within the intended environment instead of locally. Testing it locally could cause elements of your content to fail or not work properly.
- JorgeLugoCommunity Member
Phil Mayor,
I used triggers for that
Object Button Print:
1 Change state of buttom to hidden when user clic on Button Print
2 Ejecute javascrip when user clic on Button Print
Object: Hotspot 1
1 Change state of buttom Print to normal when mouse hover over.
I add a example:
But the problem is when i print the page, is blank but im working on it.
- TIMOTHYKUHNCommunity Member
window.print() javascript is nice......however for my purposes I came up with the below and it seems to work nicely (in all browsers)
Modify a Quiz Results slide.
The process to do this is basically:
1. Have a project with result slide……drag the results off of slide so user doesnt see them, however depending on your purpose you could keep them on the slide
2. Change the result slide properties to include print results btn
3. Rename/label print result btn to print handouts or whatever approp.
4. Save and publish……..not do not zip yet
5. Go to the published files…….find the story_content folder………..locate report.html in that folder………use html editor (or notepad) delete all the html in file and design it to be the document you want the user to print. Or better yet create basically an html webpage that may have links to multiple handouts, etc. Just make sure the documents that you are linking to are located within the story_content folder so to ensure that they get loaded into the lms.
6. zip the files
7. upload to lms
The process is pretty easy……..biggest thing is you must save project, publish, modify the report.html file, then zip it for the upload………..so basically same process except you have a delay between publish and zip……….to permit access to modify the report.html file. I haven't found a way to prevent the user from having to enter their name when they click the print button yet, however my hope is that maybe i can use this to track who access the material and likely printed it.
- TIMOTHYKUHNCommunity Member
Another method would be to use insert web object, save and publish, (don't zip), add html page and link to documents, images in newly created folder. Open story file link locally ot relative link (html file), save and republish with different name......copy and paste the html file out of first published and paste into the 2nd published files..........then zip and upload that to LMS..........now you have embed webpage with links to documents that is secure in SCORM, no risk of links breaking, etc.
- NickElkinsCommunity Member
Is there any chance you can use JavaScript to force the print into landscape mode? Thanks, Heroes!
- PhilMayorSuper Hero
Nick Elkins said:
Is there any chance you can use JavaScript to force the print into landscape mode? Thanks, Heroes!
You cannot set this via javascript, I normally show a layer before printing to remind the user to set it to landscape. - ValerieSeelyCommunity Member
Hi all,
I have tried the above method and I can get the file to print however the page is blank. Upon further review I can see that the page is not blank but does contain the slide outline just none of the content. Anyone have any thoughts about this?
Thanks,
Valerie
- TIMOTHYKUHNCommunity Member
Jorge,
It will just work with the result slide, but you could make the result slide look any way you want......just not sure if you can have more than one result slide. I suppose one could look into how to make a regular slide with a print button like the one that comes with result slide.