Finding Page Counts

Finding Page Counts

Forum member · Aug 8, 2006
I have a database with 40,000 pdfs in it and I want to go back and get the page counts for each file. What is the most efficient way to do this? Here's what I have so far (abbreviated): oAdapt = New OleDbDataAdapter("SELECT idFile, imgFile FROM tblFiles WHERE tFileName LIKE '%.pdf' AND nPages=0", oConn) oAdapt.Fill(ds, "Files") For Each dr in ds.Tables("Files").Rows oPDF = New PdfDocument(dr("imgFile")) nPages = oPDF.Count oPDF = Nothing oCmd.CommandText="UPDATE tblFiles SET nPages=" & nPages & " WHERE idFile=" & dr("idFile") oCmd.ExecuteNonQuery() Next Is there a better way to load the pdf into memory? Or do I have to create a new object for each read?

Re: Finding Page Counts

Support · Aug 8, 2006
Hello, There is no other way to count the number of pages other than having to create new PdfDocument object each time for every individual PDF document. Thanks, ceTe Software Support Team