print pdf using javascript

M

Mike

Hi,

I have a web application written in asp.net and C#. It generates a
bunch of pdf file using crystal report. Now I need to batch print all
those pdf files from a web page to user's local printer.

Could anyone provide any suggestions?

By the way, I found some javascript code which was claimed to print
pdf from a web page. But when I tried, the page pops up a warning
message:

"File does not begin with '%PDF-'. "

Since title of the pop up window is 'Adobe Reader', I guess that the
message is emitted by Adobe Reader. Does anyone know what the message
mean ?

My code is :
<html>
<head>
<script>
function doit() {
var x = document.getElementById("doodad");
x.print();
}
</script>

</head>
<body>
<embed id="doodad" src ="c:/test2.pdf" width="0" height="0"
name="whatever">
<button onclick="doit()">howdy</button>
</body>
</html>


Thanks ahead !
 

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

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top