Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the word document page? #539

Closed
kumfo opened this issue May 23, 2015 · 2 comments
Closed

How to get the word document page? #539

kumfo opened this issue May 23, 2015 · 2 comments
Labels

Comments

@kumfo
Copy link

kumfo commented May 23, 2015

I have a word document,now,I want to get number of pages in a Word document.What the phpword function can I use?

@RKaczmarek
Copy link

There is no function to get the current page number. The only way is to use "addPreserveText" like:

$footer->addPreserveText('Page {PAGE} of {NUMPAGES}.');

The documents you are programming with phpword are declarative. So you declare how the document should be structured and then an application, like Mircosoft Word, creates a view of this declaration.

When you add content like a textrun with a text that is two pages long, phpword doesn't programmatically know anything about the length.

@kumfo
Copy link
Author

kumfo commented May 25, 2015

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants