Click to See Complete Forum and Search --> : Javascript to print a pdf doc


pointypuss
01-15-2003, 07:39 PM
Greetings and thank you in advance for any help.

I am looking for a javascript (triggered by a html text hyperlink) to print a pdf file. I am aware of the possibility of having the user download then print the pdf but would like to print without downloading the pdf to the user's hard drive.

Is this possible?

The project this is for is at:
http://www.planetworkers.org/beta05

Click on "Notes from the Field" in the top nav. In the scrolling text of the popup you will see the link that I want to use to print the pdf.

p

jed
01-16-2003, 05:51 AM
Hi there

How about this simple one:

<a href="javascript:window.print()">Print it</a>

pointypuss
01-16-2003, 08:04 AM
I am familiar with <a href="javascript:window.print()">Print it</a>

This is not what I am looking for, as the pdf I want to print is not viewed at the time. It is an external file (a pdf version of the html text within the page).

Javascript:window.print() will just print the window, as you know.

jed
01-16-2003, 08:07 AM
Oh I see...well then I don't have it.
Good luck

khalidali63
01-16-2003, 08:27 AM
You can not use Javascript print function in this manner
window.print("FileName to be printed);

Because JavaScript merely opens up a default print dialogue of the underlying browser(which supports JavaScript),
therefore you do not have control over what goes to print froma window,
Unless may be the pdf you want to print is opened up ina frame and that frame is printed only.

Khalid

pointypuss
01-16-2003, 08:37 AM
Thanks khalidali63...

I had a feeling that that was the situation.