Viewer events

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Viewer events

Post by relapse »

Hi!

I'm working with WPF and I try to react to the events fired by viewer. Particularly I need to refresh a TextBox that shows a zooming value after a mouse click with ZoomIn tool (loupe mouse pointer). It doesn't work! Why? If I set a break point in the code, I see that the event handler isn't executed. Here is my XAML definition of the viewer:

Code: Select all

        <WindowsFormsHost Grid.Row="2" PreviewKeyDown="WindowsFormsHost_PreviewKeyDown" MouseLeftButtonDown="WindowsFormsHost_MouseLeftButtonDown">
            <AxPDFXCviewAxLib:AxCoPDFXCview x:Name="pdfViewer">
            </AxPDFXCviewAxLib:AxCoPDFXCview>
        </WindowsFormsHost>
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Viewer events

Post by Stefan - PDF-XChange »

Hello relapse,

Our Viewer AX will not automatically return notification to your main control for any mouse/keyboard input inside the Viewer - so please check section
2.2.2.10.8 Mouse
of the Viewer manual which will let you know how to get information about mouse events in it.

Best,
Stefan
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Re: Viewer events

Post by relapse »

Thanks, I'll read it.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Viewer events

Post by Stefan - PDF-XChange »

:)
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Re: Viewer events

Post by relapse »

I've found the functionality you offer to capture the viewer events very comfortable and simple e.g.:

Code: Select all

        pdfViewer.SetProperty("Notifications.Mouse.Filter", "All", 0);


        private void PdfViewerEvents(object sender, _IPDFXCviewEvents_OnEventEvent e) {
            // .................
            object dataOut;
            pdfViewer.GetProperty("Notifications.Mouse.msg", out dataOut, 0);
            if ((int)dataOut == 0x202) //WM_LBUTTONDOWN
            {
                object dataOut1;                    
                pdfViewer.GetProperty("Tools.Active", out dataOut1, 0);
                if ((int)dataOut1 == 32610 || (int)dataOut1 == 32611)
                    RefreshZoomValue();
            }
        }
Thanks for your advice. You can mark this thread as solved.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Viewer events

Post by Stefan - PDF-XChange »

:)