On Mon, November 1, 2010 21:52, José Mejuto wrote: . . > So if you are looking for ASCII words, use PDF2Text and use the POS > function over the result: > > function HaveString(Filename: String; TheString: string): Boolean; > var > F: TFileStream; > S: String; > AtPos: integer; > begin > Result:=false; > F:=TFileStream.Create(Filename,fmOpenReadOnly); > SetLength(S,F.Size); > if F.Size>0 then > begin > F.ReadBuffer(S[1],F.Size); > AtPos:=Pos(UpperCase(TheString),S); > if AtPos>0 then > Result:=true; > end; > F.Free; > end;
If I understand it correctly, this assumes reading the whole file into memory at once. Depending on the size of that file and other conditions, this may or may not be advisable... Tomas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal