If the PDF file name contains diacritics e.g."Verträge.pdf" a format exception "Input string was not in a correct format." is thrown:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Ghostscript.NET.Viewer.GhostscriptViewerPdfFormatHandler.StdOutput(String message)
at Ghostscript.NET.Viewer.GhostscriptViewerStdIOHandler.StdOut(String output)
at Ghostscript.NET.GhostscriptStdIO.gs_std_out(IntPtr handle, IntPtr pointer, Int32 count)
at Ghostscript.NET.Interpreter.GhostscriptInterpreter.Run(String str)
at Ghostscript.NET.Viewer.GhostscriptViewerFormatHandler.Execute(String str)
at Ghostscript.NET.Viewer.GhostscriptViewerPdfFormatHandler.Open(String filePath)
at Ghostscript.NET.Viewer.GhostscriptViewer.Open()
at Ghostscript.NET.Viewer.GhostscriptViewer.Open(String path, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
I checked various diacritics like ćšäö and the exception is always thrown.
As a workaround the Open(MemoryStream stream, GhostscriptVersionInfo versionInfo, bool dllFromMemory) overload works like a charm
Comments: ** Comment from web user: McZosch **
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Ghostscript.NET.Viewer.GhostscriptViewerPdfFormatHandler.StdOutput(String message)
at Ghostscript.NET.Viewer.GhostscriptViewerStdIOHandler.StdOut(String output)
at Ghostscript.NET.GhostscriptStdIO.gs_std_out(IntPtr handle, IntPtr pointer, Int32 count)
at Ghostscript.NET.Interpreter.GhostscriptInterpreter.Run(String str)
at Ghostscript.NET.Viewer.GhostscriptViewerFormatHandler.Execute(String str)
at Ghostscript.NET.Viewer.GhostscriptViewerPdfFormatHandler.Open(String filePath)
at Ghostscript.NET.Viewer.GhostscriptViewer.Open()
at Ghostscript.NET.Viewer.GhostscriptViewer.Open(String path, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
I checked various diacritics like ćšäö and the exception is always thrown.
As a workaround the Open(MemoryStream stream, GhostscriptVersionInfo versionInfo, bool dllFromMemory) overload works like a charm
Comments: ** Comment from web user: McZosch **
Same problem here.
The Unicode-workaround doesn't solve this.
The only working workaround is to read the file into a MemoryStream and then pass it to GhostScript. This adds a certain overhead, as Ghostscript.NET.Rasterizer.GhostscriptRasterizer.Open not available in a plain System.IO.Stream-signature method.
Sincerely, Markus