/    Sign up×
Community /Pin to ProfileBookmark

Open new Window with zero size

Hi,

I need to open a window and give print automaticaly.
I have done this using window.open and window.print

But when i open the window, it should not appear. only the print dialogue should come.

Is there any way to open a zero size window? or can we achieve this by some other way. If it opens and minimises itself, that also ok for me. Basically the user should not see the window and only should see the print dialogue box.

Also is there any way the new window does not appear in task bar.

I need it for IE 4.0 +

Thanks in advance,
gokul

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@toicontienApr 18.2008 — You might like print style sheets instead:

Print Style Sheets: http://www.alistapart.com/articles/goingtoprint/

Live Print Preview: http://www.alistapart.com/articles/printtopreview/
Copy linkTweet thisAlerts:
@felgallApr 18.2008 — Browsers have a minimum size that they allow windows to open at. You can't guarantee that you can get a window to open to less than 200 pixels minimum width and height as some browsers will force any window that is opened to be at least that big. You also can't guarantee that a window will open at all since some people have their browser configured to either block all new windows from opening or have them set to open all such requests in a new tab of the existing window.
Copy linkTweet thisAlerts:
@Logic_AliApr 18.2008 — Hi,

I need to open a window and give print automaticaly.

I have done this using window.open and window.print

But when i open the window, it should not appear. only the print dialogue should come.
[/quote]
How about a hidden iframe whose content document calls [I]window.print [/I]on load?
×

Success!

Help @cse_gokul 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 5.23,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...