PDFsearch.dll ============= You can use it with all well known ides (.NET-IDEs, too!) Try it with Visual Basic, VB2005 Express, VBA, Delphi, C, C++, ... You can deliver and distribute this dll as a part of your programming solution without limitation (royalty free). It's forbidden to deliver this dll alone. >>> This is the shareware version... >>> Try before you buy... >>> And if there're any questions - ask me. >>> Thanks for trying! You can get the unlimited version from: --------------------------------------- Ingo Schmoekel - Software-Dev. and Distribution - Zedernstr. 30a D-28832 Achim GERMANY Webmaster@PDF-Analyzer.com http://www.PDF-Analyzer.com http://www.IS-Soft.de About installation and working with the dll... ---------------------------------------------- This dll doesn't have an entry point so it's not necessary to register it. Only copying into the system32-directory or in the directory where your application is installed. If you're using vba (from ms access or excel for example) you should declare the functions as private and not public. Using .NET-environments (like MS Visual Studio) it's often better (to avoid stack imbalance errors) to change the parameter-types from longinteger to integer or int32 /vb2005). This is a p-invoked .dll ... If you've any problems with your ide please read here: .NET Framework Developer's Guide "Consuming Unmanaged DLL Functions" http://msdn2.microsoft.com/en-us/library/26thfadc.aspx For the library there is a help-program to test the function immediately: ------------------------------------------------------------------------- H_PDFsearch.exe As source example there is a delphi-, vb-, vb2005express- and C++ project included: ----------------------------------------------------------------------------------- PDFsearch_delphi.zip PDFsearch_vb.zip PDFsearch_vb2005express.zip pdf_sample_with_ms_cpp.zip [ to work with the sample codes the PDFsearch.dll should be in the same directory where the sample code is ] contact: webmaster@pdf-analyzer.com info/help: http://www.pdf-analyzer.com http://www.is-soft.de Ingo Schmoekel - Software-Dev.& Distribution - Zedernstr.30a D-28832 Achim - Uesen GERMANY DLL-Name: --------- PDFsearch.dll Function-Name: -------------- SearchPDF The function: ------------- function SearchPDF( const FileName: PChar; The filename to work with search: PChar; The searchstring (up to 5 single strings separated by | ao: longInt; How to search with the strings... and (0) or or (1) fa: LongInt; Find only the first (0) or all (1) sh: LongInt; Open the pdf with the first relevant page... no=0 / yes=1 ende: LongInt A stop-value (1-1800 seconds). 0 = no limitation ): PChar; stdcall; Error-Messages: --------------- E9001 //FileName File not found E9002 //search Empty search string E9003 //FileName File type isn't pdf E9007 // no app-directory-access E9008 //FileName There's a user-password E9009 // Nothing found Delphi sample code: ------------------- function SearchPDF(const FileName: PChar; search: PChar; ao: longInt; fa: LongInt; sh: LongInt; ende: LongInt): PChar; stdcall; implementation {$R *.DFM} function SearchPDF(const FileName: PChar; search: PChar; ao: longInt; fa: LongInt; sh: LongInt; ende: LongInt): PChar; stdcall; external 'PDFsearch.dll'; procedure TForm1.Button1Click(Sender: TObject); begin If OpenDialog1.Execute Then Edit1.Text := OpenDialog1.FileName; end; procedure TForm1.Button2Click(Sender: TObject); var se : LongInt; fi : LongInt; sh : LongInt; st : LongInt; su : String; Save_Cursor : TCursor; begin // search = searchstrings separated by comma // ao = searching with the option "and" (=0) or "or" (=1) // fa = first / all ... means find only the [f]irst or find [a]ll 0=first / 1=all // sh = [sh]ow the file with the relevant page 0=no / 1=yes // ende = break after xxxx seconds 1-1800 or 0 (=1 sec. upt to 30 min.) Save_Cursor := Screen.Cursor; Screen.Cursor := crHourglass; { Show hourglass cursor } if ( rbs1.Checked = True ) then se := 0 else se := 1; if ( rbf1.Checked = True ) then fi := 0 else fi := 1; if ( cbshow.Checked = True ) then sh := 1 else sh := 0; if ( Trim(Edit4.Text) <> '' ) Then Edit4.Text := Trim(Edit4.Text); st := StrToInt(Edit4.Text); su := Trim(Edit3.Text); Edit2.Text := SearchPDF(PChar(Edit1.Text), PChar(Edit3.Text), se, fi, sh, st); Screen.Cursor := Save_Cursor; { Always restore to normal } end; Visual Basic 6.0 sample code ---------------------------- 'The module ... Public Declare Function SearchPDF Lib "PDFsearch.dll" (ByVal FileName As String, ByVal search As String, ByVal ao As Long, ByVal fa As Long, ByVal sh As Long, ByVal ende As Long) As String 'The form ... Private Sub option3_Click() Dim ao As Integer Dim fa As Integer Dim sh As Integer Dim st As Integer If Option1.Value = True Then ao = 0 Else ao = 1 End If If Option4.Value = True Then fa = 0 Else fa = 1 End If If Check2.Value = 1 Then sh = 1 End If st = Val(Trim(Text6.Text)) Text3.Text = SearchPDF(Text1.Text, Text2.Text, ao, fa, sh, st) End Sub VB 2005 Express sample ---------------------- 'The module ... Option Strict Off Option Explicit On Module Module1 Public Declare Function SearchPDF Lib "PDFsearch.dll" (ByVal FileName As String, ByVal search As String, ByVal ao As Int32, ByVal fa As Int32, ByVal sh As Int32, ByVal ende As Int32) As String End Module 'The form ... Option Strict Off Option Explicit On Friend Class Form1 Inherits System.Windows.Forms.Form Private Sub option3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles option3.Click Dim ao As Short Dim fa As Short Dim sh As Short Dim st As Short If Option1.Checked = True Then ao = 0 Else ao = 1 End If If Option4.Checked = True Then fa = 0 Else fa = 1 End If If Check2.CheckState = 1 Then sh = 1 End If st = Val(Trim(Text6.Text)) Text3.Text = SearchPDF(Text1.Text, Text2.Text, ao, fa, sh, st) End Sub Private Sub Text5_LostFocus() End Sub End Class