How to print pdf document.

  • Thread starter Thread starter Yuriy
  • Start date Start date
Y

Yuriy

Hello! I need to print PDF Document by clicking a button
on .aspx page. The PDF should be printed on client printer
without displaing it on the window. I tried Process
namespace but it doesn't work.
Please, help! Thank you.
 
You cant print directly to a clients printer from asp.net - printers belong
to client side, and asp.net is server side. All you could do is feed the
PDF to the browser and hope the user printed it. Can you imagine the chaos
if we could all issue print jobs to each others printers without them doing
anything.
--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
 
John is right. you can not print using Asp.net... But here
comes javascript to the rescue :).. But I only know how to
ddo it with html pages. You still have to find out how to
aadecuate this to pdfs.

<script language="Javascript1.2">
<!--
function printpage() {
window.print();
}
//-->
</script>

Make a button or call this script directly from your page.
 
Back
Top