1

When I run my code I get the command line window popping up and it looks like it executes, but I never have an image created. I'm using the rasterize.js that came with PhantomJS

I have a number of websites I need to get a screen shot of and have stored them in a List<>.

I can't seem to narrow down just what is preventing me from having an image created. Any help would be greatly appreciated, and if there's any information that is missing or if anything needs to be clarified please let me know.

Here's my code:

foreach (var item in itemList)
    {
        string outPath = OUTPUTPATH  + "\\" + item.foldername;
        System.IO.Directory.CreateDirectory(outPath);

        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = "phantomjs.exe";
        startInfo.WorkingDirectory = @"C:\phantomjs-1.9.7-windows\";
        startInfo.WindowStyle = ProcessWindowStyle.Normal;
        startInfo.CreateNoWindow = true;

        startInfo.Arguments = "/C .\\examples\\rasterize.js " + item.url + " " + outPath + "\\" + item.filename+".jpg;

        using (Process process = Process.Start(startInfo))
        {
            process.WaitForExit();
        }

    }
shadonar
  • 1,114
  • 3
  • 16
  • 40
  • 2
    You might see if the solution http://stackoverflow.com/questions/14048895/running-phantomjs-using-c-sharp-to-grab-snapshot-of-webpage would help you debug. – scrappedcola Sep 08 '14 at 19:50

0 Answers0