OnStartDoc and other events are not working in .net 4.0

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
vineshhpatel
User
Posts: 3
Joined: Sun Aug 24, 2014 12:36 pm

OnStartDoc and other events are not working in .net 4.0

Post by vineshhpatel »

I use code:

Code: Select all

PXCComLib5.CPXCControlEx prnFactory = new PXCComLib5.CPXCControlEx();

            PDFPrinter = (PXCComLib5.CPXCPrinter)prnFactory.get_Printer("", "Simple PDF-XChange 2012", "<REG CODE>", "<DEV CODE>");
            PDFPrinter.OnStartDoc += new PXCComLib5._IPXCPrinterEvents_OnStartDocEventHandler(prn_OnStartDoc);
            PDFPrinter.OnFileSaved += new PXCComLib5._IPXCPrinterEvents_OnFileSavedEventHandler(prn_OnFileSaved);
            PDFPrinter.OnDocSpooled += new PXCComLib5._IPXCPrinterEvents_OnDocSpooledEventHandler(prn_OnDocSpooled);
            PDFPrinter.OnError += new PXCComLib5._IPXCPrinterEvents_OnErrorEventHandler(prn_OnError);
            PDFPrinter.OnStartPage += new PXCComLib5._IPXCPrinterEvents_OnStartPageEventHandler(prn_OnStartPage);
            PDFPrinter.OnEndPage += new PXCComLib5._IPXCPrinterEvents_OnEndPageEventHandler(prn_OnEndPage);
            PDFPrinter.OnEndDoc += new PXCComLib5._IPXCPrinterEvents_OnEndDocEventHandler(prn_OnEndDoc);

AddEventLog("Events inited");
            tbEventsLog.Select(0, 0);
            bPXCPrinterDefault = false;

void prn_OnStartPage(int JobID, int nPageNumber)
        {
            AddEventLog("StartPageEvent");
        }
similarly other functions.



this code works fine when using target framework .net 2.0 framework.
But its not working with target framework .net 4.0 .

I am using desktop application in C#.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: OnStartDoc and other events are not working in .net 4.0

Post by Tracker Supp-Stefan »

Hello Vinesh,

Ca you please confirm which build of our SDKs are you using?
If it is not the current latest one - please make sure to download it and test with it first:
https://www.pdf-xchange.com/product/pdf ... rivers-api

Regards,
Stefan
vineshhpatel
User
Posts: 3
Joined: Sun Aug 24, 2014 12:36 pm

Re: OnStartDoc and other events are not working in .net 4.0

Post by vineshhpatel »

Hi Stefan,

I downloaded the latest build and installed it. when I browse the example(PDFdriverAPI with C#) given in the installation directory which is having target framework 2.0, is working fine as expected.

But when I change target version to 4.0 (also including Microsoft.Csharp lib), it stops working (events not getting triggered).

Can you please help me out with this, I am stuck from months on this issue and now I need to finalize the target framework to 4.0, Otherwise I have to find another option.

Please reply as soon as possible. I am waiting.

EDIT: furthermore, I tried with .net framework 3.5 and 3.0, on which I got events triggered.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: OnStartDoc and other events are not working in .net 4.0

Post by Corwin - Tracker Sup »

Hi Vineshhpatel,

Try to turn off "Embed Interop Types" in PXCComLib5 properties (this can be done in your project references -> right click on PXCComLib5 -> "Properties") and then rebuild solution.

HTH.
vineshhpatel
User
Posts: 3
Joined: Sun Aug 24, 2014 12:36 pm

Re: OnStartDoc and other events are not working in .net 4.0

Post by vineshhpatel »

This worked perfectly.
THanks !!!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: OnStartDoc and other events are not working in .net 4.0

Post by Tracker Supp-Stefan »

:D
Post Reply