[Solved] Skip unnumbered pages for Page N of NN

Writing a book, Automating Document Production - Discuss your special needs here
Locked
SerenusZeitblom
Posts: 6
Joined: Wed Feb 12, 2025 7:30 am

[Solved] Skip unnumbered pages for Page N of NN

Post by SerenusZeitblom »

Having documents with a title page (unnumbered) followed by text pages and the demand to show <page> of <pages> in the footer. However, the "statistics" field seems to always uses the page count from the whole document. Is there a way to display only the number of numbered pages. In my example, if the doc has 26 pages, the footer on page 2 should be "page 1 of 25"? Couldn't find anything about this - but I am new to OO and may have missed something...
Last edited by MrProgrammer on Sat Feb 22, 2025 1:03 am, edited 1 time in total.
Reason: Tagged ✓ [Solved] Multiple solutions provided
OpenOffice 4.1.15 on Windows 11
User avatar
robleyd
Moderator
Posts: 5383
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Achieving something like "section pages" in MS Word

Post by robleyd »

So you want to start page numbering from something other than the first page?
See [Tutorial] Page numbering. Especially the sections Showing, hiding or restarting the page number and Total pages number by chapter or section.
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 25.2.31.2; SlackBuild for 25.2.3 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue]
Unexpected '{' on line 32
.
User avatar
MrProgrammer
Moderator
Posts: 5258
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Achieving something like "section pages" in MS Word

Post by MrProgrammer »

202502121137.gif
202502121137.gif (42.78 KiB) Viewed 6440 times
202502121121.odt
Sample document
(12.13 KiB) Downloaded 42 times
I seldom use Writer so it's possible that this simple idea may not be appropriate for your situation. If you need any additional assistance attach a Writer document demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). I will not help further unless you attach.

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.5, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
SerenusZeitblom
Posts: 6
Joined: Wed Feb 12, 2025 7:30 am

Re: Achieving something like "section pages" in MS Word

Post by SerenusZeitblom »

Thank you, Mr. Programmer. It works, in a way... my use case is I have to deal with programmatically generated DOCX files that "are as they are provided" and change these "page" and "sectionpages" fields to something useful in OO.

If I try to delete the "sectionpages" field OO tells me about read-only content that's not removable, showing field names displays - nothing. I have to delete the whole "page n of m" part to get rid of the r/o invisible...

Adding the setpage variable and pointing to it in the footer works, but the page number itself doesn't adapt, and so it shows "2 of 1", 3 of 2" and so forth.

These are 50+ page documents with a lot of confidential numbers in it. I tried to set up a sample with 3 or 4 pages, but after doing this the whole footer had gone after re-opening the odt. Will try again and attach it later.
OpenOffice 4.1.15 on Windows 11
User avatar
Hagar Delest
Moderator
Posts: 33336
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Achieving something like "section pages" in MS Word

Post by Hagar Delest »

There is a trick to anonymize a file in that topic: How to attach a document here.
It may be a vendor lock-in policy due to the use of .docx file format.
But having a look at the file would be best to see if there is an easy fix with AOO or LibreOffice (it may have a better compatibility in this case).
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
SerenusZeitblom
Posts: 6
Joined: Wed Feb 12, 2025 7:30 am

Re: Achieving something like "section pages" in MS Word

Post by SerenusZeitblom »

Thank you for providing the trick to anonymize. I attached the odt I got saving the docx (this is too large to attach). Would be very kind if you could take a look.

I attached 3 screenshots:
- Footer (the forum software doesn't attach it. Is there a maximum of attachments?)
- Footer with Field names
- Footer with selected "56" and trying to remove this
Attachments
Footer in ODT showing field names.png
Footer in ODT showing field names.png (3.7 KiB) Viewed 6363 times
Footer in ODT trying to remove the selected 56.png
Footer in ODT trying to remove the selected 56.png (20.95 KiB) Viewed 6363 times
OO_Problem_Footer.odt
(81.8 KiB) Downloaded 34 times
OpenOffice 4.1.15 on Windows 11
User avatar
Hagar Delest
Moderator
Posts: 33336
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Achieving something like "section pages" in MS Word

Post by Hagar Delest »

Well, another case where LO does better than AOO. It imported the footer better it seems since I can modify it directly:
Footer.png
Footer.png (6.05 KiB) Viewed 6360 times
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
SerenusZeitblom
Posts: 6
Joined: Wed Feb 12, 2025 7:30 am

Re: Achieving something like "section pages" in MS Word

Post by SerenusZeitblom »

@Hagar Did you manage to get displayed "page 1 of 56" on the 2nd page?
OpenOffice 4.1.15 on Windows 11
User avatar
Hagar Delest
Moderator
Posts: 33336
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Achieving something like "section pages" in MS Word

Post by Hagar Delest »

Sure, see attachment. Note the field page number at the end that has been set to a bookmark. You can then hide that text with the character properties set to hidden.
The total number of pages is 58 because of the odd/even page number rule that is explained in the tutorial linked above.
OO_Problem_Footer Hagar.odt
(81.78 KiB) Downloaded 45 times
Please add [Solved] at the beginning of the title in your first post (top of the topic) with the button if your issue has been fixed.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
SerenusZeitblom
Posts: 6
Joined: Wed Feb 12, 2025 7:30 am

Re: Achieving something like "section pages" in MS Word

Post by SerenusZeitblom »

I opened the file in LO, AOO refuses to open it, and the footer on page 2 shows "Seite 3 von 58 (total 58). Is it "Seite 1...", when you open it?
OpenOffice 4.1.15 on Windows 11
User avatar
Hagar Delest
Moderator
Posts: 33336
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Achieving something like "section pages" in MS Word

Post by Hagar Delest »

It is (LO 24.8.2 portable under Windows 10):
Footer2.png
Footer2.png (25.41 KiB) Viewed 6331 times

Note the blank page and the first page without footer.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
SerenusZeitblom
Posts: 6
Joined: Wed Feb 12, 2025 7:30 am

Re: Achieving something like "section pages" in MS Word

Post by SerenusZeitblom »

How can I make the blank page visible? How did you make the page 3 counting page 1? Can't find a field code in your document.
OpenOffice 4.1.15 on Windows 11
User avatar
Hagar Delest
Moderator
Posts: 33336
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Achieving something like "section pages" in MS Word

Post by Hagar Delest »

The blank page is visible in print preview mode or with the Book view left of the zoom slider in the bottom toolbar.
For the field, please check the tutorial linked in the first reply of this topic.
Note that in the document, I used the page number field as the bookmark text. It is easier to follow the tutorial and just put a string that says it is the last page.

 Edit: I have changed the attachment to make the bookmark more clear (not as a page number field). 
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
Locked