Keystrokes/shortcuts are not consumed by pdf control  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
User avatar
MartinCS
User
Posts: 152
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Keystrokes/shortcuts are not consumed by pdf control

Post by MartinCS » Thu Dec 21, 2017 12:45 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by Sasha - Tracker Dev Team » Thu Dec 21, 2017 12:51 pm

Hello Martin,

Try

Code: Select all

pdfCtl.Focus();
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
MartinCS
User
Posts: 152
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by MartinCS » Thu Dec 21, 2017 1:07 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by Sasha - Tracker Dev Team » Thu Dec 21, 2017 1:08 pm

Do you have the latest version of the SDK?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
MartinCS
User
Posts: 152
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by MartinCS » Thu Dec 21, 2017 1:21 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by Sasha - Tracker Dev Team » Thu Dec 21, 2017 1:26 pm

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
MartinCS
User
Posts: 152
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by MartinCS » Thu Dec 21, 2017 2:57 pm

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

User avatar
MartinCS
User
Posts: 152
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by MartinCS » Fri Dec 22, 2017 8:01 am

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

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13651
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by Tracker Supp-Stefan » Fri Dec 22, 2017 1:14 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by Sasha - Tracker Dev Team » Sat Dec 23, 2017 6:52 am

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
MartinCS
User
Posts: 152
Joined: Thu Apr 07, 2011 10:01 am
Contact:

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

Post by MartinCS » Thu Jan 18, 2018 7:33 pm

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 1079 times
// Martin

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2706
Joined: Wed Jan 03, 2018 6:52 pm

Re: Keystrokes/shortcuts are not consumed by pdf control

Post by TrackerSupp-Daniel » Thu Jan 18, 2018 7:36 pm

Sweet, thanks! :)
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Post Reply