Just been creating this… I wrote something like this a while back to use in my Office.
I wanted to keep it all in Native Hype.
The simple idea is to make your scenes as normal.
Then add a final last print scene.
The Last scene (we will call ‘Print’ ) will have the height of the combined height of all the other scenes.
i.e the normal scenes above it are each 800px.
So 800 * 4 =3200
We set the scene height just over that to 3210px.
Now we add some widgets down the length of the print scene. 4 in total.
One for each scene. The widgets each have a height of 800px to match a scene’s height and we do not get any slopping about in the widget/iframe.
Each widget is set to go to a specific url.
The URLs I have set in the example are.
./scene1/scene1.html
./scene1/scene2.html
./scene1/scene3.html
./scene1/scene4.html
These will be the paths to the individual scenes we export later.
Javascript
The 4 main scenes are set to run this JS on scene load.
This is optional depending on how you do things.
Each of the four main scenes have a print button and some nav buttons.
We do not want them showing up when the scenes load in the widgets on the print page so the JS hides these buttons only if the scene is loaded in a widget.
All the buttons are symbols and share the same class name.
if ( window.self !== window.top ){
var array = document.getElementsByClassName('hide') //— WE GET AN ARRAY OF THE CLASS OBJETCS
for (i = 0; i < array.length; i++) {
array[i].style.display = "none";;
}
}
The print Scene JS
The print scene just get code to print.
I have inserted the print command inside a setTimeOut().
This gives the scene time to load.
You probably can check if the scene has loaded before firing the print command…
setTimeout(function(){ window.print() ; }, 2000);
Finally.
We export the Project as normal.
We then use the Advanced Export to export the individual scenes/slices.
When I exported, the slices were enclosed in another folder.
I took them out and placed them on the same level as the index page.
which gave me the paths like ./scene1/scene1.html
How you work out your paths is up to you.
PrintAllScenes_mhv1.zip (1.2 MB)
TIP:
If you want the print scene to revert back to the main doc, you can move the print() function call to the print scene’s time line actions. And then also place a timeline action a few seconds later ( about 3) to switch to anothe scene.
When the print function is called a dialogue is popped up for the printing, this effectivly pauses the timeline. When the diallogue is completed the timeline starts off again and jumps the scene.
Example.
PrintAllScenes_mhv2.zip (1.2 MB)