Page 1 of 1
Column to display number of pages in PDF
Posted: 07 Jul 2023 15:48
by dogeatdog
I saw an old post about this but couldn't see an answer exactly. I have been bumping around trying things for a while now.
I would be so grateful if I could get it to work. I tried the inbuilt pages property but it only seems to work on DOCX not PDF.
I checked Windows file explorer and it doesn't display the page count either. I am using Adobe and ideally don't want to change, is there a script I can put into the column property? I would like to do this at work and I cant modify anything outside XY.
Thanks in advance.
Re: Column to display number of pages in PDF
Posted: 07 Jul 2023 18:22
by highend
Scripted custom column...
Code: Select all
$result = runret(lax("D:\Tools\@Command Line Tools\poppler_x64\pdfinfo.exe" "<cc_item>"), , 65001);
$pages = regexmatches($result, "^Pages:.+?$");
return regexmatches($pages, "\d+$");
pdfinfo:
https://github.com/oschwartz10612/poppl ... s/releases
Re: Column to display number of pages in PDF
Posted: 07 Jul 2023 18:28
by Horst
Using one of the x-PDF tools, you can get the number of pages with the -meta switch.
Create a script which extracts the Pages: line and make a custom column with it.
Code: Select all
Usage: pdfinfo [options] <PDF-file>
-f <int> : first page to convert
-l <int> : last page to convert
-box : print the page bounding boxes
-meta : print the document metadata (XML)
-rawdates : print the undecoded date strings directly from the PDF file
-enc <string> : output text encoding name
-opw <string> : owner password (for encrypted files)
-upw <string> : user password (for encrypted files)
-cfg <string> : configuration file to use in place of .xpdfrc
-v : print copyright and version info
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information
Example output:
Code: Select all
C:\Temp\PDF>C:\Tools\xpdf-tools\pdfinfo.exe -meta "Marschner Küchenrollladen.pdf"
Keywords: CreatedByIRIS_Readiris_14.1
Author: xxxx@xxx.com
Creator: Readiris Build 7941
Producer: Readiris Build 7941
CreationDate: Tue Aug 25 21:05:10 2020
Tagged: yes
Form: none
Pages: 1
Encrypted: no
Page size: 595 x 841 pts (rotated 0 degrees)
File size: 202713 bytes
Optimized: no
PDF version: 1.5
Highend was faster 
Re: Column to display number of pages in PDF
Posted: 08 Jul 2023 01:04
by dogeatdog
Guys, I am beyond happy i got this working in 5 minutes thanks to you both.
I love this community, this is a huge quality of life thing for me at work.

Re: Column to display number of pages in PDF
Posted: 04 Jul 2025 16:05
by kevin
Hi All,
So, to show a PDF file's title, author and subject, I suppose requires similar scripting work, like XY does not show that metadata out-of-the-box?
Thanks, Kevin
Re: Column to display number of pages in PDF
Posted: 04 Jul 2025 16:55
by highend
There are no Windows properties for those metadata so yes, it requires the same type of scripting