This C# code is translated from you sample TestPage2PDF.js.
Queue pdfCreatorQueue = new Queue();
pdfCreatorQueue.Initialize();
if (!pdfCreatorQueue.WaitForJob(10))
textBox1.Text = "Print job did not reach the queue";
{
PrintJob job = pdfCreatorQueue.NextJob;
job.SetProfileByGuid("DefaultGuid");
job.ConvertTo(@"w:\x\testje.pdf");
if (!job.IsFinished || !job.IsSuccessful)
textBox1.Text = "Error in process";
}
pdfCreatorQueue.ReleaseCom();
Unfortunately, it fails in the job.ConvertTo step with a dialog "Can't find a supported Ghostscript installation. Program exiting now." I tried adding the ghostscript bin directory to the path but this didn't help. Is there a workaround?