LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the current page of pdf

In my VI I load a pdf into an activeX container.

  3-7-2014 3-02-52 PM.png

I would like to be able to progammatically determine which page is currently being viewed.  I have looked throught the various property classes and method classes for the adobe pdf reader and can't find anything that will tell me what page is active.

 

Does anyone have any ideas?

 

Thanks,

 

Torry

0 Kudos
Message 1 of 7
(3,969 Views)

Well,

thinking around the subject, you could use the functions : gotoFirstPage so that you know where you start,

then remove scroll bars from the operator and just give them a Page up and Page down function (gotoNextPage gotoPreviousPage) on button press events??, not really what you wanted but if you know where you are starting from and you know how many times they have gone forward pages, then you know which page you are on!!

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 7
(3,931 Views)

Thanks James, 

 

That will work for my program if I can figure out how to disable the adobe page up/page down controls.

 

3-10-2014 7-47-21 AM.png

 

If the user uses the adobe controls instead of mine, I will lose track of which page they are on.

 

Does anyone know a way to disable the adobe controls, preferably programmatically (the program will be deployed on serveral computers)?

 

Thanks,

 

Torry

0 Kudos
Message 3 of 7
(3,893 Views)

I realized I can use the setCurrentPage method to change the page to the one my control has as the page, which will in effect disable the adobe controls, but it is not a very clean solution.

 

Can anyone think of a cleaner solution?  Or does anyone know how to determine the current page, so it wouldn't be necessary to override the adode controls? 

0 Kudos
Message 4 of 7
(3,859 Views)

Hi torry7

 

1) have you tried googling for information about the Adobe ActiveX interface? (LabVIEW will not be the only program that uses this but the interface item names should be the same so you should be able to see if someone has solved this in another programming language)

 

2) there is a property called "setShowToolbar" - have you tried disabling the toolbar with this and seeing if this allows you to do the method I suggested at first?

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 7
(3,814 Views)

Hi Torry

 

looks like some of the best have been looking at this a few years ago and found it too much of and issue to deal with - suggestion would be to stop wasting time on it:

 

http://forums.ni.com/t5/LabVIEW/OLE-Automation-Methods-for-Acrobat-Reader-in-ActiveX-Control/td-p/95...

 

Or, if you want - here is where I have got in 5 mins following my nose (see attachment)

 

Just need to get rid of navigation pane and you are sorted!!

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 6 of 7
(3,809 Views)

If you want to get the current number of PDF page, I think you may need a class to process the PDF pages. Here is a link on the same issue. But it is not designed for Ni. Maybe it can give you some insights.

 

http://tex.stackexchange.com/questions/11962/how-to-determine-current-page-number

 

 

0 Kudos
Message 7 of 7
(3,733 Views)