Searching for strings of /Pages and /Count would be highly unreliable. At worst, you would need to search the whole file, adding the entries.
To do it right, you need to get the page tree of the document catalog, then recursively look up the kids of each page tree node, increment the count, then visit the all child nodes. There are many libraries that can do this, both free, and commercial. Joe C. Hecht UberPDF.org
-- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus