Hi to All,
I have this problem:
I have a
page.asp, on my_server in intranet in which there is IIS vers. 5.1,
in this page there is a Print button and I want that, when the user-client clicks on it, it will start automatically the generation of the PDF-file of my
page.asp
I think that in the code below there are some errors because I have in the server the printer Adobe PDF put with a
Port Desktop\*.pdf and not LPT1
Then this "virtual and not physical" printer is shared in intranet with the connection-name: Adobe_PDF9 and the path of this printer is:
\\my_server_name\Adobe_PDF9
Can you help me please to correct the code below ??
Thanks a lot in advance !!!!
<%@ Language=VBScript %>
<% Option Explicit
'
Dim objFS, objWSHNet, objPrinter
'
%>
...
<body>
<%
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objWSHNet = CreateObject("WScript.Network")
objWSHNet.AddPrinterConnection "
Desktop\*.pdf", "\
\my_server_name\Adobe_PDF9"
Set objStampante = objFS.CreateTextFile("
Desktop\*.pdf:", True)
objPrinter.Write("Hello")
On Error Resume Next
objPrinter.Close
'
objWSHNet.RemovePrinterConnection "
Desktop\*.pdf:"
Set objWSHNet = Nothing
Set objFS = Nothing
Set objPrinter = Nothing
%>
<div align="center">
<p> </p>
<p>
<button onclick="window.print()">Click to Print</Button></p>
<p> </td>
</div>
</body>
The message of error is:
Invalid network adress ...
