[Libreoffice-bugs] [Bug 125682] New: Wrong calculation number of pages(field NUMPAGES) if page numbering(field PAGE) starts from EVEN number

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Jun 4 13:38:36 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=125682

            Bug ID: 125682
           Summary: Wrong calculation number of pages(field NUMPAGES) if
                    page numbering(field PAGE) starts from EVEN number
           Product: LibreOffice
           Version: 6.0.6.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: a.rudakov at team-pravo.ru

Description:
We are developing web editor of docx documents. And to convert html code
generated by user to docx/pdf document we use CLI of libreoffice. 
We have noticed a strange behavior in how libbreoffice counts number of pages
in the document. If numeration of pages starts from EVEN number - then it wrong
calculates count of pages, adding extra 1. For example if document consists of
2 real pages, and starting page number is 2 - page counter(field NUMPAGES)
shows '3'; Starting of numeration was set but manually changing attribute
'w:start' of tag <w:pgNumType> '<w:pgNumType w:fmt="decimal" w:start="2"/>' for
page section. We use only one section for entire document.
Same issue happens when we are trying to convert docx document to pdf document
using console libreoffice. Resulted pdf document also shows wrong count of
pages - same as it was in source docx-document.

So issue happened only when we set start of page numbering from EVEN page
number, for odd page number everything is going well.

GUI mode of libbreoffice also shows wrong number of pages in the document. MS
Word displays it correctly.

So my question is if there is some approach to fix this behavior by amending
internal xml code. Thanks in advance. Attaching examples of docx documents with
ODD and EVEN starting page number. 

Steps to Reproduce:
1. Create new docx document in libreoffice of 2 pages.
2. Insert field 'Page Number'.
3. Insert filed 'Page Count'.
4. Unzip created docx file.
5. Within the  file 'word/document.xml' add attribute 'w:start' to tag
'<w:pgNumType>' with any EVEN value: 2,4,6 etc. Resulted tag should be
<w:pgNumType w:fmt="decimal" w:start="2"/>.
6. Zip all files again to docx file.
7. Open resulted file from step 6 in LibreOffice.
8. Export resulted file as PDF document.

Actual Results:
Page count field displays figure '3' in both docx and pdf files.

Expected Results:
Page count field displays figure '2' in both docx and pdf files, since it's
real number of pages in documents.


Reproducible: Always


User Profile Reset: No



Additional Info:


Version: 6.0.6.2
Build ID: 0c292870b25a325b5ed35f6b45599d2ea4458e77
CPU threads: 4; OS: Mac OS X 10.14.5; UI render: default; 
Locale: ru-RU (ru_RU.UTF-8); Calc: group

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190604/509f1a0e/attachment.html>


More information about the Libreoffice-bugs mailing list