🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Upload Page Counter & Print Pricing Setup Guide

Updated 10 min read Gravity Forms Files, Storage & Databases
On this page
  1. Video walkthrough
  2. What you need
  3. Install and activate
  4. Quick start: a print order form
  5. Field settings
  6. Which files are counted
  7. What the customer sees
  8. Pricing with calculations
  9. Page limits
  10. Files that cannot be counted
  11. After submission: entry, merge tags and export
  12. Security and privacy
  13. Frequently asked questions
  14. Changelog

Video walkthrough

Gravity Forms Upload Page Counter Setup Guide: Count PDF Pages & Price by the Page
Video setup guide: Gravity Forms Upload Page Counter Watch on YouTube

The Gravity Forms Upload Page Counter & Print Pricing add-on counts the pages of every file a visitor uploads to a Gravity Forms File Upload field and uses that number in your form. The count is shown beside each file as soon as it is uploaded, the total goes into a read-only Number field that your calculations and product prices can use, and the count of every file is saved on the entry. It is built for print and copy shops, scan and binding services, translators, proofreaders and anyone else who prices by the page. This guide covers installation, the field settings, which files are counted and how, pricing with calculations, page limits, files that cannot be counted, and where the counts appear after the form is submitted.

A print order form with seven uploaded files, each showing its page count, a total of 37 pages in 7 files with the blank-pages note, the read-only Pages to print and Files fields, colour, copies and sides options and the calculated price
A print order form: a page count beside each file, the total, and the price worked out from the pages.

What you need

  • WordPress 6.5 or newer and PHP 7.4 or newer.
  • Gravity Forms 2.9 or newer (tested with 2.9 and 3.1).
  • A GravityExtra license key for this add-on.
  • A form with a File Upload field and a Number field for the total pages.

Nothing else is needed: no command-line tools, no extra library and no outside service. PHP’s standard zlib support reads compressed files, and OpenSSL (present on almost every host) is used only for AES-encrypted PDFs. Every file is read on your own server.

Install and activate

  1. In WordPress go to Plugins → Add New → Upload Plugin, choose the add-on zip file and click Install Now, then Activate.
  2. Go to Forms → Settings → Page Counter, paste your license key and click Activate License.
  3. Once the key is active, the same screen shows one more setting: Largest file to count (MB), 64 MB by default. Larger files are reported as “too large to read” instead of being counted.

Every feature of the add-on needs an active license: without one, the field settings, the counts on the form, the checks on submit, the merge tags and the entry columns are all switched off and your forms work as plain Gravity Forms forms.

Quick start: a print order form

  1. Create a form and add a File Upload field. In its General tab you can turn on Enable Multi-File Upload so customers can send several files at once; the add-on works with both.
  2. Add a Number field and call it, for example, “Pages to print”. Add a second Number field called “Files” if you charge per file.
  3. Add the options you price by: a Drop Down “Colour” with the values 0.05 (black and white) and 0.20 (colour), a Number field “Copies” and a Drop Down “Sides” with the values 1 (single-sided) and 0.9 (double-sided). Turn on show values on the Drop Downs so you can enter these numbers.
  4. Open the File Upload field, go to the Advanced tab and tick Count pages of uploaded files. Choose “Pages to print” under Put the total pages in and “Files” under Put the number of files in.
  5. Add a Product field with the field type Calculation and the formula {Pages to print:2} * {Colour:4} * {Copies:5} * {Sides:6} (the numbers are your field IDs; use the merge tag menu next to the formula box to insert them). Add a Total field.
  6. Save the form and open it on your site. Upload a few files: each shows its page count, the total appears under the field, and the price updates.

Field settings

All settings live in the Advanced tab of a File Upload field, under Count pages of uploaded files. They are saved with the field, so two upload fields on one form can have different rules.

The Count pages settings of a File Upload field: the Number field for the total pages and the number of files, minimum and maximum total pages, the out-of-range message, the blank-pages note and the choice between blocking a file that cannot be counted or allowing it with a note
The Count pages settings in the Advanced tab of a File Upload field.
  • Put the total pages in: a Number field (a Hidden field also works). On the form this field becomes read-only. When the form is submitted the add-on writes the server’s own count into it, so whatever is in the browser is ignored.
  • Put the number of files in: optional, for a per-file charge or a handling fee.
  • Minimum total pages and Maximum total pages: leave empty for no limit. The limits apply when at least one file is uploaded; make the upload field required if a file is always needed.
  • Message when the total is out of range: leave empty for the default wording, or write your own using {pages}, {min} and {max}, for example “We print {min} to {max} pages per order; you sent {pages}.”
  • Show a note that blank pages are counted: shows a short note under the total (“Every page is counted, including blank pages.” by default, or your own text). Useful when you print every page of the file as it is.
  • When a file cannot be counted: Block it with a message (default) refuses the submission and names the file and the reason; Allow it with a note accepts it, shows your note to the customer and stores the reason on the entry so you can check the file by hand.

Which files are counted

The add-on looks at the file’s content, not only at its name, so a PDF saved with the wrong extension is still read as a PDF and a text file renamed to “.pdf” is reported as damaged.

  • PDF: the number of pages in the document’s page tree, the same number a PDF viewer shows. All PDF versions from 1.0 to 2.0 are read, including the compressed object streams and cross-reference streams used by most PDF 1.5+ files, files that were edited and saved again (incremental updates) and files with a damaged cross-reference table, which are rebuilt from the objects in the file.
  • Encrypted PDF: many PDFs are encrypted only to stop editing or copying and open without a password. These are counted. A PDF that needs a password to open is counted when its page tree is readable, otherwise it is reported as “password-protected”.
  • Word (DOCX): the page count that Word, LibreOffice and most word processors save inside the document when it is saved. Some export tools leave it out; those files are reported as “no saved page count” and the customer can open and save the file again, or upload a PDF.
  • PowerPoint (PPTX): the number of slides, including hidden slides.
  • Images: JPEG, PNG, GIF, WebP, BMP, HEIC and AVIF count as 1 page each. A multi-page TIFF (common for scans and faxes) counts each of its pages.
  • Anything else (spreadsheets, old .doc files, text files, archives) is reported as “file type not supported”. Use the File Upload field’s Allowed file extensions setting to accept only the types you want.

The counts are pages of the document as it is, not sheets of paper: the add-on does not look at page sizes or at whether a page is in colour. Ask for those as normal form fields, as in the quick start.

What the customer sees

As soon as a file finishes uploading, a small badge beside its name says “Counting pages…” and then the result, such as “12 pages” or “Not counted: password-protected”. Under the field a box shows the total, for example “Total: 37 pages in 7 files”, followed by your notes and, when the total is outside your limits, the out-of-range message. Removing a file updates the total and the price straight away.

With a single-file upload field the box lists the chosen file with its count. The file is sent to your server once to be counted and then thrown away; Gravity Forms stores it as usual when the form is submitted.

A translation quote form with a single file upload: the Word document shows 7 pages, the read-only Pages field holds 7 and the quote is 84.00 at 12.00 per page
A single-file translation quote priced at 12.00 per page.

Pricing with calculations

Because the total sits in an ordinary Number field, any Gravity Forms calculation can use it. A few common set-ups:

  • Price per page: a Product field of type Calculation with {Pages:2} * 0.08.
  • Colour or black and white: a Drop Down with the price per page as its values, then {Pages:2} * {Colour:4}.
  • Copies: multiply by a Number field, {Pages:2} * {Colour:4} * {Copies:5}, or use the product’s own quantity box.
  • Double-sided discount: a Drop Down with 1 and 0.9 as values, multiplied in.
  • Per-file fee: choose a Number field under Put the number of files in and add a second product, {Files:3} * 0.50.
  • Minimum charge: set Minimum total pages, or add a fixed “Set-up” product next to the calculated one.

The calculation runs in the browser while the customer fills in the form and again on your server when the form is submitted, using the server’s count. Payment add-ons charge the server’s total.

Page limits

With a minimum or maximum set, the customer sees the out-of-range message under the total while they upload, and the form is not accepted until the total is inside the range. The check runs on your server on submit with its own count, next to the File Upload field, like any Gravity Forms validation message.

Files that cannot be counted

A file is never counted as 0 pages without a reason. The reasons are: password-protected, damaged or unreadable, file type not supported, no saved page count (some DOCX files), too large to read (over your size setting) and file not received. In Block mode the form shows “We could not count the pages of…” with each file name and its reason. In Allow mode the file is accepted, its pages are left out of the total, your note is shown, and the entry records the file as not counted so you can confirm the price with the customer.

After submission: entry, merge tags and export

The Page count box on the entry screen: every uploaded file with its field, type and pages, an encrypted tag on the password-free encrypted PDF, and a total of 37 pages
The Page count box on the entry screen.
  • Entry screen: a Page count box lists every file with its field, type and pages (or the reason it was not counted) and the total.
  • Merge tags: {page_count} is the total pages of all counting upload fields and {page_count_files} a list of every file with its count. For one upload field, add :pages or :page_list to its own merge tag, for example {Your files:1:pages} and {Your files:1:page_list}. They work in notifications, confirmations and anywhere Gravity Forms replaces merge tags, and appear in the merge tag menu.
  • Entry list and export: two columns, Total pages and Pages per file, can be added to the entry list and ticked in Forms → Import/Export → Export Entries. Total pages can also be used in the entry list filter.

Security and privacy

  • Files are read only on your server, from the folder Gravity Forms already uses for uploads. The add-on makes no outside request of its own; only the license and update checks talk to gravityextra.com.
  • The live count only reads files the form itself has stored in its temporary upload folder, by their random temporary names; any other path is refused.
  • The add-on runs no command-line programs and bundles no outside library: the PDF, DOCX and PPTX readers are its own PHP code, licensed GPL-2.0-or-later.
  • The total is set again on the server on every submission, so a changed value in the browser has no effect on the stored entry or the price.
  • Uninstalling removes the add-on’s settings. Page counts already saved on entries are kept with those entries.

Frequently asked questions

Does it work with AJAX forms and multi-page forms? Yes. Files uploaded on an earlier page keep their counts, and the total is set again on every page change and on the final submission.

Can I count several upload fields into one total? Yes. Choose the same Number field in each upload field’s settings and their totals are added together.

Why does a Word file show a different number than I expected? The DOCX count is the number of pages the word processor saved with the document the last time it was saved. If the file was changed by another program afterwards, ask the customer to open and save it again, or to upload a PDF.

What about very large files? PDFs of hundreds of pages are counted in milliseconds. The limit is the file size setting (64 MB by default), because the file is read into memory once; keep it below your PHP memory limit.

Is the count stored when the license is not active? No. Without an active license the add-on does nothing and the form behaves as a normal Gravity Forms form.

Changelog

1.0.0 (October 31, 2026): Initial release.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr