Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 1881

Printing pdf file from WCF web service

$
0
0

Hello,

I'm trying to print a pdf document form a WCF web service with the following code:

Dim info As New System.Diagnostics.ProcessStartInfo
info.Verb = "print"
info.FileName = "C:\MyFile.pdf"
info.Arguments = "MyNetworkprinter"


info.CreateNoWindow = True
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden

Dim p As New System.Diagnostics.Process()
p.StartInfo = info
p.Start()

p.WaitForInputIdle()
System.Threading.Thread.Sleep(3000)
If False = p.CloseMainWindow() Then
p.Kill()

End If


I have two problems:

1. Trying in IIS Express, it prints but always in the default printer 

2. in the deployment machine it doesn't print (never) and it doesn't give error! 

Please help. Could be a permission problem?

Thanks


Viewing all articles
Browse latest Browse all 1881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>