title: Ghostscript.Net doesn't working in Windows Server 2012 R2
body: <p>I am using Ghostscript.NET in my Project to print Pdf files across Network. Locally works fine, using Windows 10, version 64-Bit and Ghostscript Driver to 32-Bit (Ghostscript 9.22 for Windows 32-Bit) downloaded from <a href="https://www.ghostscript.com/download/gsdnld.html" rel="nofollow noreferrer">https://www.ghostscript.com/download/gsdnld.html</a>. The motivation to install 32-Bit version is the exception,</p>
  
  <blockquote>
    <p>Ghostscript.NET.GhostscriptLibraryNotInstalledException: This managed library is running under 32-Bit process and requires 32-Bit Ghostscript native library installation on this machine! To download proper Ghostscript native library please visit: <a href="http://www.ghostscript.com/download/gsdnld.html" rel="nofollow noreferrer">http://www.ghostscript.com/download/gsdnld.html</a></p>
  </blockquote>
  
  <p>, which occurs in my application log when using Ghostscript 64-Bit Driver.</p>
  
  <p>The target Operation System where I published my application is Windows Server 2012 R2. Using same Ghostscript Driver (Ghostscript 9.22 for Windows 32-Bit), print command loops indefinitely, without response to my application.</p>
  
  <p>For the purpose, I disabled the Firewall and Antivirus to eliminate possibilities of them being loop cause.</p>
  
  <p>My application reads pdf file from disk and sends it to Network Printer using Ghostscript. For simulating the process I connect to client machine remotely using TeamViewer. So, I call a REST Web Service from this machine, which saves the file to disk and uses Ghostscript to print the document in a Network Printer.</p>
  
  <pre><code>try
                  {
                      var task = Task.Run(() =&gt;
                      {
                          using (GhostscriptProcessor processor = new GhostscriptProcessor(GhostscriptVersionInfo.GetLastInstalledVersion(), true))
                          {
                              List&lt;string&gt; switches = new List&lt;string&gt;();
                              switches.Add("-empty");
                              switches.Add("-dPrinted");
                              switches.Add("-dBATCH");
                              switches.Add("-dNOPAUSE");
                              switches.Add("-dNOSAFER");
                              switches.Add("-dPDFFitPage");
                              switches.Add("-dNumCopies=" + numCopias);
                              switches.Add("-sDEVICE=mswinpr2");
                              switches.Add("-sOutputFile=%printer%" + "\\\\" + printerIP + "\\" + printerNAME);
                              switches.Add("-f");
                              switches.Add(inputFile);
  
                              processor.StartProcessing(switches.ToArray(), null);
                          }
                      });
  
                      if (!task.Wait(TimeSpan.FromSeconds(Int32.Parse(ConfigurationManager.AppSettings["MAX_PRINTER_DELAY"]))))
                      {
                          Log.Info(String.Format("A impressão do arquivo ({0}) ({1}) foi encerrada porque ultrapassou MAX_PRINTER_DELAY = {2}!", inputFile, printerNAME, ConfigurationManager.AppSettings["MAX_PRINTER_DELAY"]));
                      }
  
                  }
                  catch (GhostscriptLibraryNotInstalledException e)
                  {
                      Log.Info("O GhostScript não está instalado.");
                      Log.Error(e);
                  }
                  catch (GhostscriptException e)
                  {
                      Log.Info("O GhostScript apresentou erro.");
                      Log.Error(e);
                  }
                  catch (Exception exception)
                  {
                      Log.Error(exception);
                  }
  </code></pre>
  
  <p>I am using Ghostscript.NET version 1.2.1.0.</p>
  
  <p>Can someone help me?</p>