How to get the number of pages in a Word Document on linux?

前端 未结 4 1022
醉话见心
醉话见心 2020-12-06 11:42

I saw this question PHP - Get number of pages in a Word document . I also need to determine the pages count from given word file (doc/docx). I tried to investigate phplivedo

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 12:18

    Excluding using Abiword or OpenOffice? Impossible - number of pages will depend on number of words/letters, fonts used, justification and kerning, margin size, line spacing, paragraph spacing, number of paragraphs, columns, size of graphics / embedded objects, page / column breaks and page margins.

    You need something which will can understand all of these.

    Even if you use OpenOffice or Abiword, reflowing the text may change the number of pages. Indeed, in some cases opening the same document on a different instance of MSWord may result in a difference.

    The best you could probably manage would be a statistical approach based on a representation of the document - but you'll still see huge variance.

提交回复
热议问题