FWIW, I'm still on WinXP SP3, dual core
When I run it, the printing functionality technically works just fine, but the big textbox on the form never registers any of the events. Specifically, I'm talking about this form:
\PDF-XChange 4 API\Examples\APIExamples\C#Examples\PDFdriverAPI\Form1.cs
If you look at line 27, the method for writing to the text box, it looks like this:
Code: Select all
void AddEventLog(string sText)
{
tbEventsLog.Text = sText + "\r\n" + tbEventsLog.Text;
if (bPXCPrinterDefault)
{
PDFPrinter.RestoreDefaultPrinter();
bPXCPrinterDefault = false;
tbEventsLog.Text = "!Restored Default Printer\r\n" + tbEventsLog.Text;
}
}
Code: Select all
void prn_OnStartPage(int JobID, int nPageNumber)
{
AddEventLog("StartPageEvent");
}
My fix is to replace the AddEventLog method that starts on line 27, with a block of code that looks like this (don't forget the delegate at the end of this snippet):
Code: Select all
private void AddEventLog(string sText)
{
if (this.InvokeRequired)
{
AddEventLogCallback d = new AddEventLogCallback(AddEventLog);
this.Invoke(d, new object[] { sText });
}
else
{
tbEventsLog.Text = sText + Environment.NewLine + tbEventsLog.Text;
if (bPXCPrinterDefault)
{
PDFPrinter.RestoreDefaultPrinter();
bPXCPrinterDefault = false;
tbEventsLog.Text = "!Restored Default Printer\r\n" + tbEventsLog.Text;
}
}
}
private delegate void AddEventLogCallback(string txt);