There is currently no functionality in APJM for counting pages or rows in files that are uploaded to orders. But if you are using Pressero, and the order is being initially placed through a product page on a Pressero site, then the page or row count can be detected and will become the quantity on the order, if the option settings are enabled on the product.
If you edit a product on a Pressero site and look at the Pricing tab, there is a setting for VDP / Upload Sets Quantity. If the product is enabled to have an upload field, and the incoming file is PDF or CSV/Excel, then the pages or rows will be counted.
That setting just needs to be changed to Q1 in most cases (unless your price engine uses quantity values other than Q1) so that the quantity value comes from the page/record count on the upload file. Please check the section for VDP / Upload Sets Quantity
on the product article here
for more information.