From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search a pdf and display from that point

Hi friends,

I've got a large program that has a side feature of displaying a pdf document related to what the operator is working on. So they click the "display .pdf" button and I used Open URL in Default Browser.vi to display a pdf. This was very easy to implement.

Our operators are now requesting that we search that pdf and display the search term. So if the operator is working on Step 6, we'll want to open that pdf, search for the words "Step 6" and display that page of the pdf file. Right now we're displaying the pdf in a browser, but I wouldn't mind opening the pdf in another manner (in adobe or within labview itself). I've attached an image of how I'm opening the pdf right now.

Does anyone know how to search for words in a pdf and display the pdf starting at that searched term? LabVIEW 2017, if that matters.

 

Thank you for your time,

-Andy 

0 Kudos
Message 1 of 5
(2,412 Views)

If you get an ActiveX reference to Adobe Reader and have "Named Destinations" throughout your document, it is possible to jump to these destinations using the "setNamedDest" method.

0 Kudos
Message 2 of 5
(2,398 Views)

Hi Gregory, 

thank you for taking the time to reply to my question. Unfortunately the pdf Documents I referenced are about 1,800 in number so it’s not very realistic for me to set jump points on each. I saw a few activeX reference examples and couldn’t find one to search for a specific string. However, I was hoping someone in the community had access to a secret well of ActiveX knowledge 🙂

 

-Andy

0 Kudos
Message 3 of 5
(2,384 Views)

I have the similar issue. I need to search a pdf document by a keyword. Obviously we can open that file within LabVIEW and search there. But, it looks kind of sloppy. 

Did you resolve your issue? 

0 Kudos
Message 4 of 5
(1,225 Views)

@odessa667785 wrote:

Obviously we can open that file within LabVIEW and search there. But, it looks kind of sloppy. 


Opening the file isn't obvious.

 

PDFs do not contain plain text. The text is compressed, and can be arranged in any way a writer seems fit. On top of that, the text can be encoded in a number of ways, and the decoded character can be any glyph in an embedded font.

 

Normally, the text is top to bottom, left to right, and the encoding is pretty standard, as is the embedded font.

 

Absolutely no guarantee though.

0 Kudos
Message 5 of 5
(1,204 Views)