PDFSearchText Feature request

Feature Requests for GdPicture.NET.
btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

PDFSearchText Feature request

Post by btesch » Thu Jun 30, 2011 10:06 pm

What would it take to be able to add "Match Whole Word Only" to the search capabilities?
Bob T.

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Wed Jul 06, 2011 9:07 pm

While I am begging. :D What would it take to have a function that can either search backwards, or allow us to get a count of all of the occurances of a searched for item so we can go to the last and work our way backwards with our own code routines?
Bob T.

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

Re: PDFSearchText Feature request

Post by Loïc » Thu Jul 07, 2011 9:37 pm

Hi Bob,

Sorry for the delay. We will investigate your request within few days.

Kind regards,

Loïc

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

Re: PDFSearchText Feature request

Post by Loïc » Mon Jul 18, 2011 10:36 am

The feature has been implemented for GdPicture.NET 8.0.5

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Mon Jul 18, 2011 3:22 pm

Will it be both "Match Case" and "backward search"? Also when do you expect 8.0.5 to be out?
Bob T.

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

Re: PDFSearchText Feature request

Post by Loïc » Mon Jul 18, 2011 3:25 pm

Only "Match Case",
for backward search you have all you need to implement it from your application.
The 8.0.5 is available since 2 minutes.

Kind regards,

Loïc

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Mon Jul 18, 2011 3:29 pm

Thank you for the match case. I am a little stumped on the backward search. Do you have a snippet/example of implementing that with the tools currently available? Thanks again.

Bob
Bob T.

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

Re: PDFSearchText Feature request

Post by Loïc » Mon Jul 18, 2011 4:52 pm

You can use this function:

Code: Select all

Public Function PdfSearchText(
    ByVal Page As Integer, 
    ByVal Text As String, 
    ByVal Occurrence As Integer, 
    ByVal CaseSensitive As Boolean, 
    ByVal WholeWords As Boolean, 
    ByRef Left As Single, 
    ByRef Top As Single, 
    ByRef Width As Single, 
    ByRef Height As Single
) As Boolean
Occurrence and Page parameters can do the trick.

For example, you can count the number of occurrence on a specific page calling this function until it returns false (don't forget to increment the Occurrence parameter in your loop).
Then, when know how many occurrences are available for a specific text, you can obtain the position of the n occurrence...

It's hard to explain but very easy to implement. Hope my explanation brings some lights.

Kind regards,

Loïc

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Mon Jul 18, 2011 4:56 pm

I had though about that one, but was trying not to have an accumulator loop. Your functions are fast enough that I don't think doing the loop will be an issue. Thanks for the info.

Bob
Bob T.

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

Re: PDFSearchText Feature request

Post by Loïc » Mon Jul 18, 2011 4:58 pm

No the loop is not an issue at all.
You can expect faster result than Adobe Acrobat :)

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Mon Aug 15, 2011 11:47 pm

Well, I have finally got around to implementing and testing the WholeWord addition to the PDFSearchText function. It appears that all searches are looking for WholeWord, regardless of what is being passed to the funciton. I even tried using the overload that does not include the WholeWord bool and it searches for whole words only. I even installed the latest version (8.1.1) and retested with that one and the results are the same. Any help is appreciated.

Bob
Bob T.

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

Re: PDFSearchText Feature request

Post by Loïc » Mon Aug 15, 2011 11:59 pm

Bob,

To enable whole word option just set the WholeWords parameter to True. To disable the option, turn the parameter to False. There is nothing else to do and this works.

If you still have a problem with this parameter, please attach a document an explain what do you expect for your search.

Kind regards,

Loïc

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Tue Aug 16, 2011 2:58 pm

What I expect is quite simple. If I have passed a search text of "co", I expect it to find all instances of the letters "co" that occur on the page. This is not the case. I have words like "corn", "cooperative", "company", & "eco" on the page and it is not finding these, even if I hard code the "WholeWord" parameter to be false. It did find these before the "WholeWord" option was released. The extra finds was the reason I ask for that feature to be added. Please advise.

Bob
Bob T.

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

Re: PDFSearchText Feature request

Post by Loïc » Tue Aug 16, 2011 8:08 pm

Hi Bob,

Please attach the document as example + the code you are using to apply the search. All is working perfectly for me.

btesch
Posts: 24
Joined: Thu Jun 23, 2011 10:08 pm
Location: Kansas, USA

Re: PDFSearchText Feature request

Post by btesch » Tue Aug 16, 2011 8:47 pm

Attached is the .cs file for our viewer tool that uses GdPicture.
Attachments
RptPDFScreenViewer.zip
(10.4 KiB) Downloaded 144 times
Bob T.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest