I am trying to produce "c:\output.pdf" from existed and well formed "output.ps" file with VB.NET and shell to gswin32c.exe which is in current directory.
But I obviously can't write shell command properly:
If LCase(p_printer).Contains("ghostscript") Then
' to not show old one
IO.File.Delete(OutputPDF)
If IO.File.Exists(InputPS) Then
Dim commandString As String = """gswin32c.exe -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dQUIET -sOUTPUTFILE=" & OutputPDF & " " & InputPS & """"
Debug.Print(commandString)
Shell(commandString, AppWinStyle.NormalFocus)
If IO.File.Exists(OutputPDF) And bln_showpdf Then
'show PDF
Start(OutputPDF)
End If
Else
MsgBox(InputPS + " do NOT exists.", MsgBoxStyle.Critical)
End If
End If
From cmd window those command regularly produce "output.pdf"
What is incorrect and how to get it working?