User login

Languages

Donate

Donate for a MSI Installer Package [more]

Target:
$ 1200
Achieved:
$ 1036.55
Fees:
$ 52.53
86.4 %
Donate
SourceForge.net Logo

PDFCreator Process Stays Open

No replies
erothvt
User offline. Last seen 23 weeks 4 days ago. Offline
Joined: 09/22/2009

 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;

 

© pdfforge.org :: Contact us :: Sitemap :: Design by Daniela Martin

Validate XHTML or CSS.