1. Home
  2. Knowledge Base
  3. Advanced Calculations for Add-Ons Ultimate
  4. How to retrieve the page count of an uploaded PDF
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Field Types
  5. Calculations
  6. How to retrieve the page count of an uploaded PDF
  1. Home
  2. Knowledge Base
  3. Getting Started with Advanced Calculations
  4. How to retrieve the page count of an uploaded PDF
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Field Types
  5. File Uploads
  6. How to retrieve the page count of an uploaded PDF
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. How to retrieve the page count of an uploaded PDF

How to retrieve the page count of an uploaded PDF

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.

Was this article helpful?

Related Articles