page count sync

Discussions about document viewing.
Post Reply
glnoble
Posts: 11
Joined: Tue May 01, 2012 3:02 pm

page count sync

Post by glnoble » Tue Jun 05, 2012 5:22 am

I have navigation which allows useres to click on right or left arrows to move through pages of pdf files loaded in a gdviewer. Below the arrows is a paging indicator - Page 2 of 48 for example. This works very well and moves through the PDF perfectly. We have recently added the thumbnail viewer which also allows movement of the pages. I am trying to sync the current page of the gdviewer with the paging indicator.

running the newest version of gdpicture .net 8 as com in Microsoft Access 2010.

I have the following two routines for this purpose. Its close but the paging always shows the previous page I clicked on in the thumbnail and not the one currently displayed in the gdviewer or thumbnail?

Private Sub thumb1_ItemClicked(ByVal idx As Long, ByVal button As MouseButton)
Call Display_page
End Sub

Private Sub Display_page()
lbPage.Caption = "Page " & GdViewer1.CurrentPage & " of " & GdViewer1.PageCount
End Sub

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: page count sync

Post by SamiKharma » Tue Jun 05, 2012 9:16 am

Hi,

The reason for that is simple, as a design, the thumbnail index counting starts from 0, and the page numbering starts from 1.

Best Regards,
Sami

glnoble
Posts: 11
Joined: Tue May 01, 2012 3:02 pm

Re: page count sync

Post by glnoble » Tue Jun 05, 2012 2:01 pm

Good thought but not the problem. Here is an example. I have a 10 page doument. I click on a thumbnail for page 1, it shows page 1 in the viewer. I click on page 5, it shows page 5 in the viewer but the page indicator is 1 of 10. I click on page 8, it shows page 8 in the viewer but the page indicator shows page 5 of 10.

it always gives me the previous page selected in the thumbnail. its not a zero based paging problem.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: page count sync

Post by Loïc » Tue Jun 05, 2012 2:30 pm

Hello,

The ItemCLicked event is fired before the GdViewer page change. So you have to catch the ItemSelectionChanged or the MouseUp event.

Regards,

Loïc

glnoble
Posts: 11
Joined: Tue May 01, 2012 3:02 pm

Re: page count sync

Post by glnoble » Tue Jun 05, 2012 6:29 pm

Just and FYI itemselectionchanged and mouseup produced the same results. I altered the setting of the label to the following procedure which works great.

Thanks for the guidance!

Private Sub thumb1_ItemClicked(ByVal Idx As Long, ByVal Button As MouseButton)
lbPage.Caption = "Page " & Idx + 1 & " of " & GdViewer1.PageCount
End Sub

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest