If you want to make a special printable (and self-printing) page, this example is probably more complex than you need. So you have a page that is all set for printing – no background colors or images, high-contrast, small page size, vertical orientation – then all you need to do is open the Page/Extended dialog, click on New, and enter the following Name/Value pair:
- onload
- if(window.print) return window.print();
Note carefully that you would apply this only to the print-only page, not the page containing the link to that page. This code will booby-trap the page to instantly print itself the moment it is fully loaded. And as you are no doubt aware, this will only go so far as to present a Print dialog to the user, prompting her to click Okay, not actually fire up the printer and send the paper through it.
Now, back at your normal browser-friendly page, link to your print-friendly page from the Print button graphic, and for bonus points, use the Target: _blank scheme to open a new window. At the moment, the Print button links back to the same page it is on using a JavaScript link scheme, which is why you are seeing the # appended to the link.
The other way to handle this (preferable, in my opinion) is to create a print stylesheet that horses around the current map page into something more printable. Then your print button can have the following link applied to it:
javascript:window.print()
A print stylesheet will allow you to do all sorts of things that would normally require a separate page – remove elements like the print button itself, change the geometry of the page, font-size, color, substitute a different all-black map image, substitute a large and readable URL for the navigation, really anything you might want to print but not show the web visitor.
Walter
On Jun 9, 2013, at 12:00 PM, LauraB wrote:
Using a technique with extended dialog that Walter described on this forum, I created a secondary page to print only the map and directions you see on the referenced page. The secondary page opens through the built-in Link to New Window action.
Problem is, when the print button on the original page is clicked and opens the secondary, linked page, that page does not automatically print. I thought that was the point of adding the action. Am I missing something?
Also, why does my page link included her put that # after the html? It doesn’t show in the inspector pane for the page I created.
http://www.laurabelgrave.com/tester/location.html#
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options