Forum Discussion
Need Javascript Help with Printing a Page (fixed height/width)
Hi Julio,
I've mocked up your project for you.
I added a layer to handle the print function to print your map. The new layer contains the webobject required to print the map When you click the button to show the layer, the layer displays. When the webobject shows, it immediately wants to print the image and opens a print dialoge to choose a printer. I've included a PDF output of the printed output. I've also included the index.html file that I created for this project. I included the javascript and CSS needed in the html file:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PrintDoc</title>
<style>
@media print {
@page {
size: A4;
margin: 1in;
}
}
img {width: 7in;}
</style>
<script>
function init(){
window.print();
}
</script>
</head>
<body onload="init();">
<img src="FloorPlan.png" />
</body>
</html>
I hope this helps your with your project.
Dave
Hi Dave. Unfortunately I can't seem to access our conversation on E-Learning Heroes as the page is not loading (I'm replying to your post via email). I've already notified support. As soon as I'm able to access the post, I'll review your reply. Regardless, thank you for taking the time to assist.
Related Content
- 4 months ago