Printing from WebPage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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??
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top