title: Ghostscript PDF to TIFF setting output size c#
body: <p>I have a pdf of 22 pages. I am using GhostScript to convert the PDF to TIFF to be used by Tesseract. I did this...</p>
  
  <pre><code>  string filename=openFileDialog1.FileName;
  
    using (GhostscriptRasterizer rasterizer = new GhostscriptRasterizer())
              {
                  rasterizer.Open(filename, _lastInstalledVersion, false);
                  for (int pageNumber = 1; pageNumber &lt;= rasterizer.PageCount; pageNumber++)
                  {
                    Image img = rasterizer.GetPage(400, 400, pageNumber);  
                  }
  </code></pre>
  
  <p>I want to set the img size before I pass it to be used by Tesseract but I cant.. Is there any way?</p>
  
  <p>There is this example: but idk if I can pass each image from the pdf to be used by Tesseract</p>
  
  <pre><code>  GhostscriptVersionInfo gv = GhostscriptVersionInfo.GetLastInstalledVersion();
  
          using (GhostscriptProcessor processor = new GhostscriptProcessor(gv, true))
          {
              processor.Processing += new GhostscriptProcessorProcessingEventHandler(processor_Processing);
  
              List&lt;string&gt; switches = new List&lt;string&gt;();
              switches.Add("-empty");
              switches.Add("-dSAFER");
              switches.Add("-dBATCH");
              switches.Add("-dNOPAUSE");
              switches.Add("-dNOPROMPT");
              switches.Add(@"-sFONTPATH=" + System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts));
              switches.Add("-dFirstPage=" + pageFrom.ToString());
              switches.Add("-dLastPage=" + pageTo.ToString());
              switches.Add("-sDEVICE=png16m");
              switches.Add("-r96");
              switches.Add("-dTextAlphaBits=4");
              switches.Add("-dGraphicsAlphaBits=4");
  
              //switches.Add("-sDEVICE=pdfwrite");
  
              switches.Add(@"-sOutputFile=" + outputFile);
              switches.Add(@"-f");
              switches.Add(inputFile);
  
              processor.StartProcessing(switches.ToArray(), null);
          }
      }
  </code></pre>