LibreOffice: text for the footer of the last page

I want to create a custom LibreOffice Writer template for our company. This template should include the following code on the last page of each document.

In our existing M $ Word template, we use a field with "IF ({current page} = {last page}; ...", but LibreOffice does not seem to be able to use the current page number in conditional texts. The LibreOffice help page says:

You cannot use internal variables, such as page and section numbers, in a condition expression.

Using a custom page style for the last page also does not seem to be a good solution, because if someone inserts too much content into this β€œlast page” and causes the page to break automatically, he gets a disclaimer twice.

How to create a footer in LibreOffice, which will be automatically displayed on the last page of the document, but not on any other page?


edit: I was able to write a macro that can insert a page break for the last page. Still not a complete solution, but there may be a way to go:

Sub PageBreakForLastPage ' create cursor Cursor = ThisComponent.CurrentController.getViewCursor ' move to start of last page Cursor.jumpToLastPage Cursor.jumpToStartOfPage ' create page break Cursor.BreakType = com.sun.star.style.BreakType.PAGE_BEFORE Cursor.PageDescName = "First Page" End Sub 
+4
source share
1 answer

We had the same problem using the OpenOffice template engine (I believe it is the same: D), and the only way to solve this problem is to add a footer with a custom field for the page number and fill it after each page is created .

0
source

All Articles