🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 31, 2026

How to Price Print Orders by the Page with Gravity Forms

GravityExtra
How to Price Print Orders by the Page with Gravity Forms

If you run a print shop, a copy and scan service, a thesis binding counter, a translation agency or a proofreading business, you probably price by the page. And if you take orders through a website, you have probably met the same problem: the order form asks the customer how many pages they are sending, the customer guesses, and someone on your team has to open every file, count again and send a corrected quote before anything can be printed or paid for.

Gravity Forms is a popular choice for order and quote forms because its calculations and product fields can turn answers into a price. What it cannot do on its own is look inside an uploaded file. This guide shows how to close that gap: how to count the pages of uploaded PDF, Word, PowerPoint and image files automatically, show the count to the customer while they fill in the form, and feed it straight into your price. It is written for shop owners and for the developers who build their sites, and it uses the Gravity Forms Upload Page Counter & Print Pricing add-on for the counting.

Why a “how many pages?” box is not enough

Asking the customer to type the number of pages looks simple, but it causes trouble at every step of the order:

  • Guesses are wrong. People count the pages they wrote, not the pages in the file. A title page, a table of contents, appendices and blank separator pages are easy to forget.
  • Several files make it worse. A customer who uploads a report, two appendices and a cover image has to add up four numbers in their head.
  • Wrong numbers mean wrong prices. If the quote is too low you either absorb the difference or go back to the customer after they have paid. If it is too high, they may leave before ordering.
  • Checking by hand does not scale. Opening each file to check the count is fine for five orders a week. At fifty it is a part-time job.
  • Anyone can change the number. A number typed in the browser can be edited before the form is sent, so a price based on it cannot be trusted.

The fix is to let the website do the counting, on the server, from the files themselves, and to use that number — not the customer’s — for the price.

How page counting works for different file types

Before setting anything up, it helps to know what “the number of pages” means for each kind of file a customer might send.

PDF files

A PDF stores its pages in a structure called the page tree, and every PDF viewer shows the number of pages from it. Reading that tree sounds easy, but real PDFs vary a lot. Older files (PDF 1.4 and earlier) list their objects in a plain table at the end of the file. Most files made today, by office suites, design software and online tools, use the PDF 1.5+ features of object streams and cross-reference streams, which compress the page tree inside the file. Files that were edited and saved again carry several versions of the page tree, and only the newest one counts. And some files are damaged, with a cross-reference table that points to the wrong places.

Then there is encryption. Many PDFs are encrypted only to stop editing or copying: they open without a password, and their pages can be counted. Others need a password to open at all; a reliable counter has to say so clearly instead of returning zero.

The Upload Page Counter add-on handles all of these with its own PHP reader: classic tables, PDF 1.5+ object and cross-reference streams, incremental updates, damaged tables (which it rebuilds from the objects in the file) and encrypted files that open without a password, using RC4, AES-128 or AES-256. Files that need a password are flagged as password-protected. In testing it agreed with a standard desktop PDF tool on every one of nearly 300 real-world PDFs, from version 1.1 to 1.7.

Word documents (DOCX)

A Word document does not have fixed pages: where a page ends depends on the fonts, the printer settings and the program that lays it out. When a word processor saves a DOCX, though, it records the number of pages it laid out in the document’s properties. That saved count is what the add-on reads. It matches what the customer saw when they last saved the file. A few export tools do not save it; those files are reported as having “no saved page count”, and the customer can simply open and save the file again or send a PDF.

Presentations (PPTX)

For a PowerPoint file the useful number is the number of slides, which is stored the same way. If the property is missing, the add-on counts the slides in the file directly.

Images and scans

A photo or a scanned page is one page. JPEG, PNG, GIF, WebP, BMP, HEIC and AVIF files each count as one. Scans and faxes are often saved as multi-page TIFF files, and those count each page inside the file.

Everything else

Spreadsheets, old .doc files, archives and text files have no reliable page count. The add-on reports them as “file type not supported” rather than inventing a number. You can also limit the accepted types with the File Upload field’s allowed extensions.

Setting up a print order form step by step

Here is a complete print order form with a price that follows the files. It takes about ten minutes.

  1. Add a File Upload field. In its General tab, turn on multi-file upload if customers may send several files. Set the allowed extensions, for example pdf, docx, pptx, jpg, png and tif.
  2. Add a Number field for the pages. Call it “Pages to print”. This field will hold the total and will be read-only on the form. Add a second Number field called “Files” if you also charge per file.
  3. Add the options you price by. A Drop Down “Colour” with show values on and the price per page as values, for example 0.05 for black and white and 0.20 for colour. A Number field “Copies”. A Drop Down “Sides” with 1 for single-sided and 0.9 for double-sided if you give a discount for double-sided printing.
  4. Turn on page counting. Open the File Upload field, go to its Advanced tab and tick “Count pages of uploaded files”. Under “Put the total pages in”, choose “Pages to print”; under “Put the number of files in”, choose “Files”.
  5. Add the price. Add a Product field with the Calculation type and a formula that multiplies the fields together: pages times colour rate times copies times sides. Use the merge tag menu beside the formula box to insert each field. Add a Total field.
  6. Test it. Open the form, upload a few files and watch each one get its page count, the total appear, and the price update when you change the options.
A print order form with a page count beside each uploaded file, a total of 37 pages in 7 files, the read-only pages field, colour, copies and sides options and the price
Each file shows its page count; the total and the price follow as files are added or removed.

Pricing ideas that use the page count

Once the total pages sit in a Number field, Gravity Forms calculations can do the rest. Some set-ups that work well:

  • Simple per-page price for copying or scanning: pages times a fixed rate.
  • Colour versus black and white: a Drop Down whose values are the per-page rates.
  • Copies and sides: multiply by the number of copies and by a factor for double-sided printing.
  • Translation and proofreading: pages times your rate per page, with a second drop-down for urgency.
  • Binding: a product priced per copy, plus a surcharge when the total pages pass a threshold, using conditional logic on the pages field.
  • Per-file handling: the number of files times a small fee, useful when each file has to be checked or converted.
  • Minimum order: a minimum number of pages, so very small jobs either cost a fixed set-up fee or are not accepted online.

Because the add-on writes the server’s own count into the pages field on submission, the stored price is always based on the real files, even if someone edits the number in their browser.

Setting limits and handling problem files

Most shops have practical limits: a minimum for an online order, a maximum for a binding size or for same-day service. Set a minimum and a maximum total in the field settings, and write the message the customer sees when they are outside the range, using placeholders for the pages, the minimum and the maximum. The message appears under the files while they upload, and the form will not be accepted until the total fits.

Some files will always need a person: a PDF that needs a password, a damaged file, a format you did not expect. You choose what happens to them. Block them, and the customer sees each file name with the reason and can upload a better file straight away. Or allow them with a note, for example “We could not count the pages of this file; we will confirm the price before we print”, and the order goes through with that file marked on the entry so your team knows to check it. Either way, an unreadable file is never quietly counted as zero pages.

If you print every page exactly as it is in the file, it is worth saying so. A short note under the total, such as “Every page is counted, including blank pages”, answers the question before it is asked.

Single-file quotes

Not every form takes a pile of files. A translation or proofreading quote usually takes one document. The add-on works the same way with a single-file upload: when the customer chooses the file, it is counted on your server and the count appears under the field, with the price.

A translation quote form with one uploaded Word document showing 7 pages and a quote of 84.00 at 12.00 per page
A one-file translation quote priced per page.

What your team sees after the order

Every entry keeps the count of each file. The entry screen has a page count box listing each file with its type and pages, and a total. Two columns, total pages and pages per file, can be added to the entry list and to the CSV export, which makes it easy to reconcile a day’s orders or report on volume. In notifications, merge tags print the total pages or a list of every file with its count, so the order e-mail to your production team already says what to print.

Privacy and performance

Customers’ documents are often private: contracts, theses, medical letters, legal papers. The add-on reads them only on your own server, in the folder Gravity Forms already uses for uploads, and sends nothing to any outside service. It runs no command-line programs and needs no extra library. Counting is fast: a 240-page PDF is counted in a few milliseconds, so the customer sees the result almost as soon as the upload finishes.

A quick checklist

  • Decide which file types you accept and set the allowed extensions.
  • Add a Number field for the total pages, and one for the files if you charge per file.
  • Turn on page counting on each upload field and point it at those fields.
  • Build the price with a calculation that uses the pages field.
  • Set a minimum and maximum if you have them, with a friendly message.
  • Choose whether files that cannot be counted are blocked or allowed with a note.
  • Add the page count merge tags to your order notification.
  • Test with a few real files from past orders, including a large PDF and a scan.

Frequently asked questions

Does the count match what a PDF viewer shows?

For PDFs, yes: the add-on reads the same page tree a viewer uses. For Word files, it is the count the word processor saved, which matches what the author saw when they last saved the document.

Can a customer change the price by editing the page number?

No. The pages field is read-only on the form, and on submission the server counts the files again and overwrites whatever value was sent.

Does it work with several upload fields on one form?

Yes. Each upload field has its own settings, and several fields can add their totals into the same pages field.

Does it work with multi-page and AJAX forms?

Yes. Files uploaded on an earlier page keep their counts, and the total is set again each time the form moves on.

What happens to password-protected PDFs?

If the file opens without a password, it is counted. If it needs a password, it is shown as password-protected and handled by your block-or-allow setting.

Get started

Counting pages by hand is one of those small jobs that quietly eats hours every week. Let your order form do it, and price every job from the real files. Read the setup guide for every option, or get the Gravity Forms Upload Page Counter & Print Pricing add-on and add page counting to your forms today.

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