[Solved] Make header/footer read-only
[Solved] Make header/footer read-only
[Solved] Hi i am able to create header/footer through java but i am not able to make it read-only. Is there any method or libraries for the same?
Last edited by robleyd on Tue Mar 25, 2025 4:26 am, edited 3 times in total.
OpenOffice 4.1.15 on Windows11
- Hagar Delest
- Moderator
- Posts: 33350
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Is there anyway to make the header/footer read-only?
Not that I know of, directly.
Not tested: you can try to insert a section in the header/footer and protect it.
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.
Not tested: you can try to insert a section in the header/footer and protect it.
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.
Re: Is there anyway to make the header/footer read-only?
Another untested strategy, if Hagar's suggestion does not help you:
It may be possible to protect the entire document, but have an inserted section which is editable.
I don't know how to do either programmatically, though. Hopefully you'll find out.
It may be possible to protect the entire document, but have an inserted section which is editable.
I don't know how to do either programmatically, though. Hopefully you'll find out.
Re: Is there anyway to make the header/footer read-only?
With a mousehandler and keyhandler you can intercept mouse and key presses and prevent their action eg by testing to see if the text has the ImplementationName SwXHeadFootText.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Is there anyway to make the header/footer read-only?
There is a different approach. See attached example. I made it with LibO 25.2.1. In AOO menu paths and setting dialogs are different, but you will easily find what you need.
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Is there anyway to make the header/footer read-only?
ThankYou guys for the replies, was able to make it read only by adding the header/footer in a text section and used isProtected property to protect it and prevent editing.
OpenOffice 4.1.15 on Windows11
Re: [Solved] Is there anyway to make the header/footer read-only?
As a cosmetic enhancement you could add, on each page, a form controls label anchored to the page, with blank text so it is invisible (so long as the form controls design mode is off). Using the label to cover from the bottom of the header to the top of the page and extending it to the page edges you can stop clicking in the header to edit it.
Edit: and also, if you wanted, the blank label is a method of adding a tooltip for where it covers.
Edit: and also, if you wanted, the blank label is a method of adding a tooltip for where it covers.
- Attachments
-
- stop clicking in heading.odt
- (9.19 KiB) Downloaded 17 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)