How to known if PDFXChange showing the end of the last page

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

marcoscmonteiro
User
Posts: 37
Joined: Thu Jan 01, 1970 12:00 am

How to known if PDFXChange showing the end of the last page

Post by marcoscmonteiro »

I'm trying to automate change of PDFXChange opened document when the user are viewing the end of last page and press keyboard "Page Down". Same when the user press keyboard "Key up" and viewing top of first page.

There is a way to do this?
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7370
Joined: Wed Mar 25, 2009 10:37 pm

Re: How to known if PDFXChange showing the end of the last p

Post by Paul - PDF-XChange »

Hi marcoscmonteiro,

the scroll bar actions are handled a little differently than others. If you set the Page Up and Page down to be associated keystrokes for First Page and Last Page they are intercepted and still send one page up/down events.

It would be better to choose other keys to associated with these actions. By default in the Viewer these are set to Home and End. Unless you have a very good reason for not using these you may want to reconsider this.

hth
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
marcoscmonteiro
User
Posts: 37
Joined: Thu Jan 01, 1970 12:00 am

Re: How to known if PDFXChange showing the end of the last p

Post by marcoscmonteiro »

Perhaps I'm not being clear with my question. Sorry for my bad english. I'll try again:

We are implementing a Lawsuit eletronic system in "Rio de Janeiro" State Court using PDFXChange ActiveX. One lawsuit can consist of hundreds of PDF documents. When a user is viewing the last page of one of these documents and press "Page Down" key we want to execute one of these actions:

1) If the last page is NOT displayed to its end we want to process normal behavior of this key to show full document last page.
2) If the last page is displayed to its end we want to show the first page of next lawsuit PDF document.

Similarly the same can occur when viewing the first page of a document and the user press "Page Up" key...
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: How to known if PDFXChange showing the end of the last p

Post by Walter-Tracker Supp »

You must create a keyboard event handler in your application that intercepts page down events, and if you are on the last page, post a user defined message to the message queue. You must not call ActiveX methods from the keyboard handler itself.

Then in your event handler for your user-defined next document message, close the current document with CloseDocument() and open the next one with OpenDocument(); Disable the user interface with the flag PXCVA_NoUI.

Please note that in the keyboard event handler you must use PostMessage or another asynchronous method to call your separate event handler that handles this message and loads the new document. You cannot do it directly from the keyboard event handler:

http://support.microsoft.com/kb/131056
marcoscmonteiro
User
Posts: 37
Joined: Thu Jan 01, 1970 12:00 am

Re: How to known if PDFXChange showing the end of the last p

Post by marcoscmonteiro »

Ok. I understand that I cannot use PDFXChange keyboard event handler.

But I cannot see how to programmatically known if the last page is full displayed or not so I can go to next lawsuit document or not.

I attached a picture explaining what I mean by "last page not full displayed"
You do not have the required permissions to view the files attached to this post.
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: How to known if PDFXChange showing the end of the last p

Post by Walter-Tracker Supp »

You would need to get the scroll bar position, but unfortunately there is no way to do this with the current version. It will be in version 3.

In the meantime you could write a solution using the Simple Viewer DLL, but you have to handle most of the viewing-related features that are provided by the ActiveX control yourself, so I recognize that this is not a very convenient answer.

If you have the zoom level and screen size fixed you may be able to come up with a cheap hack that counts the number of page-down events after each page change is detected... but this is obviously not optimal. Otherwise perhaps trap a combination key event like Ctrl-PgDown / Ctrl-PgUp to jump documents.

-Walter
marcoscmonteiro
User
Posts: 37
Joined: Thu Jan 01, 1970 12:00 am

Re: How to known if PDFXChange showing the end of the last p

Post by marcoscmonteiro »

Thanks.

I will wait v3 for implement this functionality
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7370
Joined: Wed Mar 25, 2009 10:37 pm

Re: How to known if PDFXChange showing the end of the last p

Post by Paul - PDF-XChange »

8)
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com