This is a fully functional .Net DLL that can be incorporated in to virtually any Windows Program that supports .Net components. We have provided some sample
source code to show how you could use this DLL in your program
Visual Basic.Net (VB.net)
Add a refernce to the DLL in the Project (.NET reference)
- In Visual Basic.Net, click on the 'Project' menu, then click on 'Add References'
- Click the 'Browse' button and find the SCPDFPageCountNetDLL.dll
- Double Click it so that it appears in your 'Available References' Page
Include this code in the beginning part of your program (or you could put this in your module)
Dim pcount As New SCPDFPageCountNetDLL.PDFPageCountDllv1
Now, create a sub or function to get the page count, (the following is a sample you could use):
Public Function GetPages(UseFileName as String) As Long
GetPages = pcount.PDF_PageCount(UseFileName)
End Function
The 'UseFileName' is the variable that contains the FULL path to the PDF file.
To call the function and get the number of pages in the PDF file, you could use the following:
msgbox("Number of Pages: " & GetPages("c:\temp\testpdf.pdf"))