Please help me

Problem with ASP.Net and VB.Net

Page 1 of 1

2 Replies - 1127 Views - Last Post: 17 December 2008 - 09:18 PM Rate Topic: -----

#1 ishrat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-December 08

Please help me

Posted 17 December 2008 - 09:07 PM

I have got a problem.
I want to print some pdf file automaticaly from client pc with ASP.net. and VB.net.
My code are as follows:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim oPs As New System.Drawing.Printing.PrinterSettings
Dim sPrinter  As String = oPs.PrinterName
Dim pathToExecutable As String = "C:\Program Files\Adobe\Reader 9.0\Reader\acrord32.exe"

RunExecutable(pathToExecutable, "/t ""\\10.113.10.199\invpdf\081121_1815702_28082708_081120_HPA9233S.pdf"" ""sPrinter"") 

End Sub       
  
Public Function RunExecutable(ByVal executable As String, ByVal arguments As String) 

Dim starter As ProcessStartInfo = New ProcessStartInfo(executable, arguments)

starter.CreateNoWindow = True
starter.WindowStyle = ProcessWindowStyle.Hidden
starter.RedirectStandardOutput = True
starter.UseShellExecute = False
Dim Process As Process = New Process()
Process.StartInfo = starter
Process.Start() 
Return Nothing
End Function



It is working properly from Server not from client. But from client pc it cant find out the client default printer. Thats why I passed the client default printer name as a parametter and tested but it didnt work. any body can give me the solution please.

Thanks
Ishrat Jahan

Is This A Good Question/Topic? 0
  • +

Replies To: Please help me

#2 ishrat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-December 08

Re: Please help me

Posted 17 December 2008 - 09:16 PM

I have got a problem.
I want to print some pdf file automaticaly from client pc with VB.net and ASP.net.
My code are as follows:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim oPs As New System.Drawing.Printing.PrinterSettings
Dim sPrinter As String = oPs.PrinterName
Dim pathToExecutable As String = "C:\Program Files\Adobe\Reader 9.0\Reader\acrord32.exe"

RunExecutable(pathToExecutable, "/t ""\\10.113.10.199\invpdf\081121_1815702_28082708_081120_HPA9233S.pdf"" ""sPrinter"") 

End Sub 

Public Function RunExecutable(ByVal executable As String, ByVal arguments As String) 

Dim starter As ProcessStartInfo = New ProcessStartInfo(executable, arguments)

starter.CreateNoWindow = True
starter.WindowStyle = ProcessWindowStyle.Hidden
starter.RedirectStandardOutput = True
starter.UseShellExecute = False
Dim Process As Process = New Process()
Process.StartInfo = starter
Process.Start() 
Return Nothing
End Function


It is working properly from Server not from client. But from client pc it cant find out the client default printer. Thats why I passed the client default printer name as a parametter and tested but it didnt work. any body can give me the solution please.

Thanks
Ishrat Jahan
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Please help me

Posted 17 December 2008 - 09:18 PM

Please don't create duplicate topics, it only clutters things and it isn't going to get you helped any faster. Please remember, we all volunteer here to help, we have lives and families so at times it can take some time to get a response.

Topics merged :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1