Page 1 of 1

Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 12:45 pm
by MartinCS
Hi,

the PDF-XChange Editor is part of our application in order to view/edit pdf documents. The activeX control is embedded inside of a .NET class library and a windows form. The communication between the main application and the PDF Editor activeX control is via COM. My problem is when I open the windows form containing the activeX and bring it to the front with the windows form property 'WindowState' maximized all keystrokes/shortcuts inside of the focused PDF Editor activeX control are not consumed. The focus is still in the underlaying main aplication. So, all shortcut operations are handeled inside of the main application instead of the activeX control. Therefore shortcuts like copy and paste and all other PDF-XChange Editor shortcuts don't work.

I tried serveral ways to set the initial focus to the activeX control when it gets maximized on the screen. But all with no success.

Is there a property which I need to set for the pdf control to force the activeX control to it's shortcut opperations?

// Martin

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 12:51 pm
by Sasha - Tracker Dev Team
Hello Martin,

Try

Code: Select all

pdfCtl.Focus();
Cheers,
Alex

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 1:07 pm
by MartinCS
Hi Alex,
Sasha - Tracker Dev Team wrote:Try

Code: Select all

pdfCtl.Focus();
was my first guess. I also called the method twice (in different routines). But my efforts were with no luck.

// Martin

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 1:08 pm
by Sasha - Tracker Dev Team
Do you have the latest version of the SDK?

Cheers,
Alex

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 1:21 pm
by MartinCS
That's a good question!

No, I don't use the latest version because we experienced several errors with the v7 including unexpected crashes and memory access violations when trying to call SDK functions.

Currently, I'm working with:

COM name: PDFXEdit.PXV_Inst
API version: 1.9.0.0 (0x01090000)
Full path: "C:\Program Files (x86)\Tracker Software\Editor SDK\Bin\PDFXEditCore.x86.dll"
File version: 6.0.322.7
Resource path: "C:\Program Files (x86)\Tracker Software\Editor SDK\Bin\Resources.dat"

// Martin

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 1:26 pm
by Sasha - Tracker Dev Team
Hello Martin,

Well, why am I asking, because there were a fix for the focus matter in the latest version. You can try using the latest dll with this problem and see whether it persists.

Cheers,
Alex

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Dec 21, 2017 2:57 pm
by MartinCS
Alex,

I installed the latest Version:

COM name: PDFXEdit.PXV_Inst
API version: 1.9.0.0 (0x01090000)
Full path: "C:\Program Files (x86)\Tracker Software\Editor SDK\Bin\PDFXEditCore.x86.dll"
File version: 7.0.323.2
Resource path: "C:\Program Files (x86)\Tracker Software\Editor SDK\Bin\Resources.dat"

Unfortunelly, it's not solving my issue. I still don't get focus on the pdf control and I don't know what I can do about that.

Beside that, I do have the issue (with the latest Version) that I can't use my settings file (*.xcs) which has been created with v6 (see topic from PDF-XChange Editor Forum: https://www.tracker-software.com/forum3 ... rt#p119453). I'm not able to execute operation 'op.settings.import' successfully because of an out of memory access violation when running the operation do-method:

Code: Select all

var op = pdfCtl.Inst.CreateOp(pdfCtl.Inst.Str2ID("op.settings.import"));
                                
if (op != null)
{
	op.Params.Root["Options.History"].v = false;
        op.Params.Root["Input"].v =
        FsInst.DefaultFileSys.StringToName(filePathSettings);
        op.Do();
}
// Martin

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Fri Dec 22, 2017 8:01 am
by MartinCS
Hi Alex,

this solution was the most promising but doesn't solve the focus issue either:
https://www.tracker-software.com/forum3 ... us#p106009

In this thread and the last post you mention that the issue is solved in version 323:
https://www.tracker-software.com/forum3 ... 66&t=29906
Hello Jeroen,

Even when I click inside the empty canvas (to be sure it has focus), shortcuts are not working.

This is fixed now and will be available from the next major release (323) in a couple of weeks or so.

Cheers,
Alex
I tested both methods:

Code: Select all

Doc.ActiveView.PagesView.Obj.SetInputFocus(true);
pdfCtl.Focus();
with shortcuts enabled/diabled:

Code: Select all

pdfCtl.AllowedShortcuts = true/false;
But all efforts are with no success so far.

// Martin

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Fri Dec 22, 2017 1:14 pm
by Tracker Supp-Stefan
Hello again Martin,

As I posted in your other topic - I've passed these to Sasha - but he will be able to attend to those tomorrow.

Happy holidays,
Stefan

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Sat Dec 23, 2017 6:52 am
by Sasha - Tracker Dev Team
Hello Martin,

To solve this quickly, please send us a small working sample project and the reproduction steps. If I can recreate the behavior, I will give this project to the developer responsible for this functionality and we will hopefully fix this quickly.

Cheers,
Alex

Re: Keystrokes/shortcuts are not consumed by pdf control  SOLVED

Posted: Thu Jan 18, 2018 7:33 pm
by MartinCS
Hi Alex,

I just want to let you know that I was able to solve the issue by myself. I had a com visible class library which I accessed from Lotus Notes. For some reason Lotus Notes maintained the focus despite the fact that the main windows form with the pdf control was maximized and opened.

I changed the whole implementation. Now, I'm using a com bridge (separate com visible dll) which pipelines the calls via WCF to a separate windows forms application. This works very well so far and I did notice a slight increase of performance as well when the Windows form with the pdf control is maximized.

Here you can see my new concept. Maybe it helps other devs facing similar problems or gives them new ideas:
concept.png
concept.png (8.69 KiB) Viewed 1145 times
// Martin

Re: Keystrokes/shortcuts are not consumed by pdf control

Posted: Thu Jan 18, 2018 7:36 pm
by TrackerSupp-Daniel
Sweet, thanks! :)