After I run the code below the PDFCreator.exe process stays running. How can I force it to close?
clsPDFCreator creator = new clsPDFCreator();
string parameters = "/NoProcessingAtStartup";
if (creator.cStart(parameters, false))
{
clsPDFCreatorOptions opt = creator.cOptions;
// Set parameters for saving the generating pdf automatically to a directory.
// Use auto save functionality.
opt.UseAutosave = 1;
// Use directory for saving the file.
opt.UseAutosaveDirectory = 1;
// Name of the output directory.
opt.AutosaveDirectory = @"c:\\";
// Format in which file is to be saved. 0 if for pdf.
opt.AutosaveFormat = 0;
// Name of the output file name.
opt.AutosaveFilename = "bdtext";
creator.cOptions = opt;
}
creator.cPrinterStop = false;
PrintDialog pd = new PrintDialog();
pd.PrintQueue = new PrintQueue(new LocalPrintServer(), "PDFCreator");
pd.PrintDocument(document.DocumentPaginator, "");
// Wait till all doc get converted to pdf.
while (creator.cCountOfPrintjobs != 0) ;
creator.cPrinterStop = true;
creator.cClose();
creator = null;