|
This might not be shared by others, but here it goes. If your CLI program is a file-format conversion utility, please include a way to dump meta-data, header formats, etc. Don't just silently convert from A to B, allow me to get at the info you have gathered from the input. For example, a binary disassembler SHOULD dump the executable header format. An spreadsheet converter utility SHOULD display how many sheets there are, if there are macros, how many rows, etc. One of my pet peeves is pdftotext, a very nifty utility that I use to convert PDF reports to ASCII for subsequent awking. pdftotext has an option to specify start and end pages to extract, but it doesn't have an -i or --info option that tells me how many pages a PDF file has. So, my scripts have a very high upper-limit, like 1000, and it converts the file page by page, until the output text page has a size of zero. Which reminds me, I should probably fork the fucker this weekend, now that I have some free time. |
You could use pdfinfo - in Debian / Ubuntu, it is in the same package as pdftotext (poppler-utils).
To extract (only) the number of pages of a PDF: