ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Normally, if you have a .doc open in MS Word or another office application like LibreOffice, there is a status bar at the bottom of the window. At the left side in Libre is the page count, for example: Page 1 of 7 Can't recall if it is exactly the same in Word, but certainly somewhere on that status bar.
Wow, I also just realized how poorly stated my original question was, I apologize for the confusion.
With that said, thank you SrDorothy and catkin for your replies. I often deal with directories with hundreds or thousands of files in them of varied file types. Opening each one is not viable in my case, which is why I am wondering if there is something like xpdf or pdfinfo that works for text files, word files, and maybe, hopefully, spreadsheets.
So, what I want to be able to do is to run a script or series commands that will give the a total page count of all files in a directory, regardless of file type. That script would, therefore, probably include programs like xpdf or pdfinfo.
actually you can change the number of pages by changing the font or margin, so I think you need to open the file and evaluate the content somehow. Maybe perl can help you, there are some modules to open documents and spreadsheets (either openoffice or MS office)
Distribution: Debian Sid AMD64, Raspbian Wheezy, Slackware Current AMD64, various VMs
I doubt you can do it for spreadsheets since I don't think "page"means anything uuntil you come to print out and select print areas, and sometimes spreadsheets contain hidden cells or large areas of nothing. That and you could have any nmber of tabs.
Use the command line interface for LibreOffice to accomplish this.
The brute force method is to use the example shown, exporting the document as PDF to a temporary file, then count the number of pages in it. It should work, but it does feel more than a bit clunky.
You might be able to write a macro that uses the print preview function to find out the number of pages, without generating any temporary files. Check out the documentation. You should be able to run that macro similar to the example, getting the page count directly.
pan64 & 273: I actually have a macro that formats .xls files for printing and gets rid of blank space, I think it leaves the fonts alone so maybe I just need to find a way to expand on that to output the page count once it has formatted it.