Forum moved here!

Home / How do I Print a web site document?



I am printing succesfully a pdf document with VB .NET from my PC in silent mode like this

Dim drucken As String = "C:\projekte\SumatraPDF\SumatraPDF.exe"
Dim pr = New Process
pr.StartInfo.FileName = drucken
Dim filename As String = "C:\Users\mgbig\Documents\docs\packinglist.pdf"
pr.StartInfo.Arguments = "-silent -exit-on-print -print-to-default " & filename

Now I want to print a document, that I will find on a web page like this

I tried just to change this line
Dim filename As String = "C:\Users\mgbig\Documents\docs\packinglist.pdf"
Dim filename As String = ""

but nothing happens. When I remove -silent -exit-on-print then an error shows up “File could not be printed”

but unfortunately nothing happens. Is there a way to print out a pdf in silent mode?
Thanks a lot


That is the way it works using either the local file or a file within a served file system

You can not print a URL like http:// as it is not a physical file:///.

I see no reason to use silent as all you are asking is to NOT show me error messages, the workstation command line printing itself is not silent, it by necessity uses the graphics engine, thus can cause problems within non graphic servers.

The solution is to curl the file to a graphics enabled workstation then monitor CLI printing for errors without silent.
In CLI language you could possibly write a single line command string but for similar need to view see How do I open a web document? - #5 by GitHubRulesOK


Thanks for the answer. I found a solution by downloading it first and then print it. That works fine:

DownloadFile ("", "C:\projekte\Docs\packinglist.pdf")

and I now understand I do not need silent mode.