/    Sign up×
Community /Pin to ProfileBookmark

Is there a way to make a page auto print? I am pretty sure the automatically printing isn’t allowed, but is there a way to pop up the file>print box upon page load?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@xplanowestxMar 03.2009 — Heres an AuTO Print Script, now it might pop-up with a active content restriction so the user will have to accept that, but it's an auto print. Somewhat. They would also just have to press print
[CODE]<html>
<head>
<script type="text/javascript">
<!--
function printthispage() {
window.print();

}
//-->
</script>
</head>
<body onload="printthispage()">

This page will print
</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@dzirkelbauthorMar 03.2009 — An even simpler effect I found to work is this:

<body onLoad="self.print()">

Thanks for the response!
×

Success!

Help @dzirkelb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...