If Preview = True Then
' Show it
fx.ShowExternalDocument(File.GetUri(DataDirName , DataFileName))
Sleep(2000)
ret = True
Else
' Print it
Dim Params As List : Params.initialize
' Params.Add("-print-dialog ")
Params.Add($"-print-to "$)
Params.Add($"""$)
Params.Add(Printer)
Params.Add($"" "$)
' Params.Add("-exit-when-done ")
Params.Add(DataDirName & DataFileName)
Dim js As Shell
js.Initialize("js", "sumatraPDF.exe", Params)
js.WorkingDirectory = File.DirApp
js.Run(-1) ' No timeout
Wait For js_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Log("Shell Success=" & Success & ", StdOut=" & StdOut & ", StdErr=" & StdErr)
If Success Then
ret = True
Else
ret = False
End If
End If