Document.SearchText and SearchTextEx

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Any1
Posts: 6
Joined: Mon Aug 11 2008

Document.SearchText and SearchTextEx

Post by Any1 »

Hello,

im using the function Document.SearchText Function to search for words in searchable pdf-files.

Looks like this:


Amyuni3_1.Open('C:\Temp\Test.pdf);
IF Amyuni3_1.SearchText(-1,'2521739',page,xpos,ypos) THEN
MESSAGE('found!');

Works with some documents, with others it does not.
Thats already written in the manual, so its prolly a wrong text type.

Now i wanted to try the SearchTextEx function:

Amyuni3_1.Open('C:\Temp\Test.pdf);
IF Amyuni3_1.SearchTextEx(-1,'2521739',page,xpos,ypos) THEN
MESSAGE('found!');

When executing this code, it says it was not able to handle one of the arguements?
According to manual, the handles should be the same as SearchText?!

-1 = Integer = StartPage
2521739 = TextString to search for
page = Integer for page number
x/ypos = Decimal for the coordinates

What do i have to change with SeachTextEx
David
Amyuni Team
Posts: 89
Joined: Mon Dec 18 2006

Re: Document.SearchText and SearchTextEx

Post by David »

Hello

The parameters for the SearchText and SearchTextEx are the same. The only difference in the two methods is that SearchText only works with WinAnsi encoded streams, but not with other encodings. The SearchTextEx is also more accurrate than the SearchText.

In your code we would recommend explicitly defining your search string e.g.

Dim strFind As String
strFind = "2521739"


Amyuni3_1.Open('C:\Temp\Test.pdf);
IF Amyuni3_1.SearchText(-1,strFind,page,xpos,ypos) THEN
MESSAGE('found!');

Hope that helps?
David
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
Post Reply