473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Printing from WebPage

Hi all,
i was wondering if there was a way to directly print a document to the
user's printer, without having to download it first...
I needed something like a button, and when the user clicks the button, a
print preview window , or adobe, whatever.. will open up and allow the user
to see what the document looks like, then have the open to close it or print
it...
is that possible??
--
Ad****@hotmail.com
Nov 19 '05 #1
2 1665
Sort of / kind of, but it depends on the document types and the browser and
exactly how you want this all to work.

If you're printing HTML or Text documents (both of which most web browsers
can print), you'd do this by creating your own HTML pop-up "print preview"
window with a frameset, a toolbar (with your print, close buttons). The
body of the frameset would actually display the document. Print would
invoke some Js indicating (I believe) which frame you want printed, and
you're good.

If you documents are not HTML or text than they're probably not browser
printable or viewable. You'll need a separate application that can open,
read, display, print the file. Acrobat, Excel, Word, PowerPoint all work in
this manner. Many of these have an embedded viewer that will open in your
browser, which is kind of neat but In many (all?) cases it means your
javascript print button won't work. Instead you'll have to print directly
from the vewer. Acrobat is a perfect example of this; all functions (print,
save, copy) relating to the document must be done using the acrobat toolbar,
not the browser toolbar.

I'm not aware of any way to avoid downloading a document before printing it;
you have to get it to the client system somehow in order to get it to the
client's printer. Though, someday soon, we might see the ability to print a
Url, which tells the printer to go get the document. Why not, eh?

With the HTML and text documents, you could probably download the document
to a hidden 0-pixel-wide frame so the user doesn't see it, if that's what
your asking. The javascript to print should still work in that case.

Anything fancier, you're probably stuck with ActiveX controls or a lot of
user documentation to explain what do do with different document types.

/// M

"ACaunter" <Ad****@hotmail.com> wrote in message
news:FC**********************************@microsof t.com...
Hi all,
i was wondering if there was a way to directly print a document to the
user's printer, without having to download it first...
I needed something like a button, and when the user clicks the button, a
print preview window , or adobe, whatever.. will open up and allow the user to see what the document looks like, then have the open to close it or print it...
is that possible??
--
Ad****@hotmail.com

Nov 19 '05 #2
Thanks for the reply.
My document is a word document.. so do i have to convert this somehow to a
pdf or something to view the file in the acrobat viewer.. or can i keep it in
the .doc format... if it's too much to print directly, or at least print
preview.. what is the simpliest amount of code to download the .doc file to
the user...
thanks

"MWells" wrote:
Sort of / kind of, but it depends on the document types and the browser and
exactly how you want this all to work.

If you're printing HTML or Text documents (both of which most web browsers
can print), you'd do this by creating your own HTML pop-up "print preview"
window with a frameset, a toolbar (with your print, close buttons). The
body of the frameset would actually display the document. Print would
invoke some Js indicating (I believe) which frame you want printed, and
you're good.

If you documents are not HTML or text than they're probably not browser
printable or viewable. You'll need a separate application that can open,
read, display, print the file. Acrobat, Excel, Word, PowerPoint all work in
this manner. Many of these have an embedded viewer that will open in your
browser, which is kind of neat but In many (all?) cases it means your
javascript print button won't work. Instead you'll have to print directly
from the vewer. Acrobat is a perfect example of this; all functions (print,
save, copy) relating to the document must be done using the acrobat toolbar,
not the browser toolbar.

I'm not aware of any way to avoid downloading a document before printing it;
you have to get it to the client system somehow in order to get it to the
client's printer. Though, someday soon, we might see the ability to print a
Url, which tells the printer to go get the document. Why not, eh?

With the HTML and text documents, you could probably download the document
to a hidden 0-pixel-wide frame so the user doesn't see it, if that's what
your asking. The javascript to print should still work in that case.

Anything fancier, you're probably stuck with ActiveX controls or a lot of
user documentation to explain what do do with different document types.

/// M

"ACaunter" <Ad****@hotmail.com> wrote in message
news:FC**********************************@microsof t.com...
Hi all,
i was wondering if there was a way to directly print a document to the
user's printer, without having to download it first...
I needed something like a button, and when the user clicks the button, a
print preview window , or adobe, whatever.. will open up and allow the

user
to see what the document looks like, then have the open to close it or

print
it...
is that possible??
--
Ad****@hotmail.com


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: gb | last post by:
Hi All, Ive created a popup page using 'var openWindow = window.open("new","pop")' And added content using openWindow.document.write(" "); statements. But now I would like to be able to print...
4
by: venkat | last post by:
Hi all, I need print a webpage from internet explorer. The page may contain images, links, stylesheets etc. how will i send all these things to server side for printing. I am using asp.net with...
0
by: Krzysztof Malinowski | last post by:
Hi, I made a webpage (using C#), once hosted it on WebMatrix server on WinXP. When I printed the page was the same like in browser. Twice I put the same webpage on WebMatrix on Win2K, when I...
2
by: edx | last post by:
Hi, this question has probably been ask a hundred times before, but searching through this newsgroup I have not found any solution to my problem: I want to make my asp.net website print on the...
17
by: Alan Z. Scharf | last post by:
How can I disable the IE6 Print button and Ctrl-P for an ASP.Net web application? Thanks. Alan
3
by: carlor | last post by:
Hi there, Our client has a requirement to print labels from the web site to a local printer. i.e. user logs onto web site and click a print button and the address is printed to a label printer...
1
by: uto | last post by:
i'd like to know about printing of webpage ListView tablele this listview is like resume table forms so i have to print as this page of table type. may be listview count is about 50. how can i...
4
by: Brooke | last post by:
Is there a way to prevent a user from printing a webpage?
0
by: ESmith | last post by:
I need to create a website that receives documents from multiple users. When an manager comes in, he needs / wants to be able to select one, several, add of the documents, and have them formatted...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.