Dear Developer team,
I have tried using the code below:
…
using PDFCreator;
namespace myNameSpace
{
public partial class progMain
{
clsPDFCreator _pdfCrt;
clsPDFCreatorError pdfErr;
[STAThread]
public void Main()
{
try
{
pdfErr = new clsPDFCreatorError();
_pdfCrt = new clsPDFCreator();
_pdfCrt.eError += new __clsPDFCreator_eErrorEventHandler(_pdfCrt_eError);
_pdfCrt.eReady += new __clsPDFCreator_eReadyEventHandler(_pdfCrt_eReady);
if(!_pdfCrt.cStart("/NoProcessingAtStartup", false)) throw new Exception(“PDFCreator error”);
clsPDFCreatorOptions pdfOpt;
pdfOpt = _pdfCrt.cOptions;
pdfOpt.UseAutosave = 1;
pdfOpt.UseAutosaveDirectory = 1;
pdfOpt.AutosaveDirectory = @“C:”;
pdfOpt.AutosaveFilename = “testing”;
pdfOpt.AutosaveFormat = 0;
_pdfCrt.cOptions = pdfOpt;
/* cannot use this method to put the cOptions to _pdfCrt directly
_pdfCrt.cOptions.UseAutosave = 1;
_pdfCrt.cOptions.UseAutosaveDirectory = 1;
_pdfCrt.cOptions.AutosaveDirectory = @“C:”;
_pdfCrt.cOptions.AutosaveFilename = “testing”;
_pdfCrt.cOptions.AutosaveFormat = 0;
*/
_pdfCrt.cClearCache();
Application.DoEvents();
myApplication.PrintOut();
Application.DoEvents();
_pdfCrt.cPrinterStop = false;
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}
void _pdfCrt_eReady()
{
_pdfCrt.cPrinterStop = true;
}
void _pdfCrt_eError()
{
pdfErr = _pdfCrt.cError;
_pdfCrt.cPrinterStop = true;
}
}
}
As I comment out, the code in comment does not make effect to the PDFCreator COM Object because the Dialog box still appears after the program running. If I using this library in the unpreferred way, please suggest
Best Regards,
Kang