473,739 Members | 4,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to print pdf document.

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.
Nov 17 '05 #1
2 1948
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_auth or_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_autho r_plug>
----------------------------------------------

"Yuriy" <yl******@hotma il.com> wrote in message
news:01******** *************** *****@phx.gbl.. .
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.

Nov 17 '05 #2
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="Javas cript1.2">
<!--
function printpage() {
window.print();
}
//-->
</script>

Make a button or call this script directly from your page.
-----Original Message-----
You cant print directly to a clients printer from asp.net - printers belongto client side, and asp.net is server side. All you could do is feed thePDF to the browser and hope the user printed it. Can you imagine the chaosif we could all issue print jobs to each others printers without them doinganything.
--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_aut hor_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_autho r_plug>
----------------------------------------------

"Yuriy" <yl******@hotma il.com> wrote in message
news:01******* *************** ******@phx.gbl. ..
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.

.

Nov 17 '05 #3

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

Similar topics

2
16016
by: dan | last post by:
This works in mozilla but I can't figure out why this won't work in IE. Say I have this html <html> header goes here header goes here
4
2188
by: Julie Siebel | last post by:
Apologies...I'm sure this has been asked before, but I can't seem to come up with the correct Google search terms. While my problem is with stylesheets, the errors are being caused by my javascript, so this seemed a more appropriate place to post. I'm using a media=print style sheet to do a version of a web page that I am building. Currently, I'm working on the IE version. I have an HTML page and 2 style sheets which all validate...
3
8356
by: Craig | last post by:
First of all, this one is driving me crazy, so thanks in advance for any help!! I've got a javascript function in a parent document that generates an HTML document on the fly when a button is clicked... that generated popup contains a button that's supposed to print the contents of the popup window (self). However, the button won't print (nothing happens on click) from the newly generated popup to print the contents of the window... the...
21
5734
by: Steel | last post by:
Hi at all, I have a very long html page with many photo. Therefore the best to print this page is to print the some page as PDF. Therefore I maked a PDF file like my page to print best. I'ld want that when the user press the print button in the browser , it print automatically the pdf file and not the html page. To do that I insert at the top of my page: <link media="print" rel="alternate" href="printthepage.pdf"> But it do not work and...
2
2887
by: Asad | last post by:
I have a main window that creates a new window called printWin (which contains the printable format of the page). From the main window I embed a javascript in the printWin window that calls the "window.print()" function. So it looks like this: printWin.document.write ("<FORM>"); printWin.document.write ("<INPUT TYPE=\"BUTTON\" NAME=\"btnPrint\" VALUE=\"Print\" ONCLICK=\"javascript:window.print()\">"); printWin.document.write ("</FORM>");
1
5714
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
22
130334
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the document and closes it with the following code: <body onload="window.print(); window.close();"> This works correctly (or at least the way I expect it to work under MS Internet Explorer, but it cuases Netscape to "crash"
10
3853
by: jon | last post by:
I'm trying to use a hidden iframe to print the contents of one div seamlessly. Currently I can create the hidden iframe, copy the contents of the div to the iframe, and print it. I even have a method that initially copies all the original page's styles onto the new iframe to maintain look and feel. So far things work, and the div (along with look and feel from styles) are successfully copied to the iframe and printing just the hidden...
2
22123
by: Brad Pears | last post by:
I have some sample code that uses the print dialog, print preview and a print direct options. If I select print preview and then click the printer icon from that, the document prints. If I select the print directly option, it also prints right away to the defauilt printer. However, if I use the printer dialog control to print and I click 'OK' to actually print the document - nothing happens. The job does not even go into the print...
10
8838
by: S_K | last post by:
Hi, I have a directory full of a number of .PDF files that I need to print. Is there any simple way to do this? Using PdfReader purhaps? Thanks in advance. Steve
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.