Footer only on last page

How can i insert text in footer only on last page automatically?

In MS WORD i can do this:
{IF {NUMPAGE}={PAGE} “true” “false”}

But var PageNumber(or NumPage) is not availible in LibreOffice for custom fields.
Why?

Update (to ajlittoz):
Last page content is a continuation of the previous page.
Last page footer is “My name and my phone number”.
It is rule of my company.

What is last page content? Is is just a common page containing the last bit of text? Is it a “special” page, like a TOC, an index, an appendix, a postface or back cover? In other words, is there a logical topic break between it and the previous page?

Please answer my questions editing yours. Do not “Add Answer” for that.

This is not a “correct” usage of footer: a footer s supposed to contain some “permanent” information valid for a whole part of the document. What you are requesting is rather a kind of signature in a specifically dictated position.

Since it is a one-shot indication, I don’t recommend putting it in the footer. This is my suggestion of an auto-text or sample auxiliary utility document (so that you only need to copy and paste).

Create a frame in a dedicated empty paragraph. The frame will be anchored to this paragraph as To paragraph. Vertical position is set From top of Entire page (because there is no “from bottom”) and you tune the distance so that it is located where you want it to be. Horizontal position is selected according to your rules, likely to be centred.

Don’t forget to remove the border which comes by default.

Enter your information using whatever paragraph style to achieve the desired layout.

If needed, the anchoring paragraph, i.e. the one where you inserted the frame, can be reduced to need nearly no space by setting its font size to 2pt (the absolute minimum in Writer) and spacings above and below to 0. This is necessary to avoid creating an empty page with only the “signature” in some circumstances (a full last page).

Once everything ready, save for easy future use.

A few remarks:

  • If you have a real footer and this “signature” is supposed to replace it, make the frame as wide as your text area and use a non-transparent background, like white, to hide the real footer.

  • You can also play with the frame width and horizontal position to hide selected elements of the real footer, e.g. to keep the page number.

  • You may experience some difficulty later when you try to modify the frame: it is next to impossible to select it with a mouse click because it lives outside the main text area; then temporarily reduce the bottom margin to zero, ignoring the warning, select the frame and later restore the margin.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

Thank you! It solves my problem! But i don’t understean why LO doesn’t support variable NUMPAGE like MS WORD… I think it is possible.

I ain’t a developer, only an enlightened user, so I can only guess. This conditional text feature seems to be offered for “dynamically composed documents” (something like a generic contract with many clause variants). The document would be “instantiated” through setting user variables. Page count or page number are internally managed by Writer and user is barred from interfering with them. I suppose read-only variables are not allowed in conditional expressions, by design. That said, I agree there are cases in which it could be useful. However, in the present question, I do think it would be an abuse of the abstract notion of footer.

Hi Ajlittoz,

I saw your comment on adding signature.

I have a requirement to add signature image at last page.
for example, if my form goes to 2 page and if there is space to accommodate signature it should print at the bottom before footer. if the text in 2ndpage ends exactly before footer then the signature should not print with empty page on 3rd page.

Pls suggest me some ways to add Signature at last before footer dynamically based on the contents.

@jaiganesh I think this is a different question/issue than this one. So, ask your own question, eventually mentioning this one as a related case (with a link), while I think over your problem.
And don’t forget to mention OS name, LO version and save format.