3
Vote

GhostscriptRasterizer process dies if feed a bad pdf regardless of try catch

description

                using (var rar = new GhostscriptRasterizer())
                {
                    try
                    {
                        //WARNING: this process will fail if its not a real pdf or the pdf is corrupt.
                        rar.Open(filePath, GetInstalledVersions(GhostscriptLicense.GPL).SingleOrDefault(), true);
                        var count = rar.PageCount;
                        //WARNING: this process will fail if its not a real pdf or the pdf is corrupt.
I have the above code in a try catch and it still kills the process for my application.

Why does the GhostScript process not just throw an exception, but instead just dies and my try catch is pointless with this.

comments