I have excel file with several sheets, and I need to know how many pages per each sheet. Thank you
Asked
Active
Viewed 427 times
1
-
can you tell me which php library you are currently using or supposed to use to make it work ? – Mittul At TechnoBrave Mar 14 '17 at 11:03
-
Additionaly, you can follow this link http://stackoverflow.com/questions/15365599/phpexcel-check-if-sheet-exists – Mittul At TechnoBrave Mar 14 '17 at 11:03
-
Possible duplicate of [PHPExcel Check if sheet exists](http://stackoverflow.com/questions/15365599/phpexcel-check-if-sheet-exists) – PereG Mar 14 '17 at 11:13
-
@Mittul At TechnoBrave I'm using Phpexcel – Tina Mar 15 '17 at 00:33
-
My question is how to count total pages of each sheet. I know how to get total sheets. But I want to total page/ sheet. Thank you – Tina Mar 15 '17 at 00:37
-
@Tina total page of each sheet ? did not get you.. you mean number of rows per sheet ? – Mittul At TechnoBrave Mar 15 '17 at 04:41
-
If so then check this out http://stackoverflow.com/questions/4562527/how-to-find-out-how-many-rows-and-columns-to-read-from-an-excel-file-with-phpexc – Mittul At TechnoBrave Mar 15 '17 at 04:42
-
@Mittul At TechnoBrave It's not mean number of rows per sheet. Because in some cases user can set format of sheet like 50 rows/page, but in another sheet user can set up to 100 rows per page. – Tina Mar 15 '17 at 05:09
1 Answers
0
When the Excel file view is set on Page Break Preview, the pagination becomes visible. I think that this is what you need.
The pagination depends by the installed printer on that machine, the Paper Size set for the sheet and if any additional page breaks that are set for the sheet.
There is no such a function that returns the number of pages. MS Excel doesn't store such information inside the Excel file format.
You can write function that interpret the bellow elements. You must also take care of how many rows fit in Paper Size height (each row height has a role) and how many columns fit in Paper Size width (each column width has a role).

alex.pulver
- 2,107
- 2
- 31
- 31