You can now access the page count for a PDF upload in your calculations by using this tag: {field_xxx_pdf_count}
Note that you will need the Pro version of Add-Ons Ultimate and the Advanced Uploads extension to retrieve an uploaded PDF’s page count.
The first step is to enable the feature by going to WooCommerce > Settings > Product Add-Ons > Uploads. Enable these settings and click ‘Save changes’.
- Enable PDF uploads
- Enable PDF page count
Then, create the following fields.
An Upload field which now accepts a PDF file. You will need to disable ‘Allow multiple uploads’ as the calculation will only read 1 file.

Create a Calculation field that will reference the Upload field. When a PDF file is uploaded, the calculation will retrieve the number of pages.

Troubleshooting
Error getting the PDF page count
If you see the following error message when a user uploads a file:
There was an error in getting the PDF page count: This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI.
You can use the following snippet:
<?php | |
function test_page_count_method( $method ) { | |
return 'preg_match_all'; | |
} | |
add_filter( 'wcpauau_page_count_method', 'test_page_count_method' ); |
Here’s how to add a snippet.