Can LibreOffice be forced to only read documents? (disallow editing)

Just out of curiosity, is there a way to do a LibreOffice installation (on Windows) where it will open all files in read-only mode without allowing any editing?

I ask for the purpose of an install on machines that are generally public-facing and designed to allow end users to quickly just open and print files, but not edit them. Currently the Microsoft Office Viewers are being used for this, and the latest Word viewer is from 2003. LibreOffice actually does phenomenally better at this point in opening *.docx files accurately (since the 2003 Viewer will open the files but ignore any parts of the document made in Office 2007 or newer) and it would also add ODF to things that users could open and print on these stations.

Not something to particularly need to rush on, worst-case the answer is no such feature exists and there’s no harm in keeping the current setup. I would just appreciate knowing if it’s even possible to consider this, and if so what it would involve.

Hi @AnonymousJoe,

Sounds like your question might be a duplicate of this one: Put LibreOffice as unedited document viewer only

Thoughts?

While it’s not a “fix” I second Mark12547’s suggestion to export the “public use read only” files to PDF. I maintain a few files (Calc & Writer contact lists, ID#s, etc.) which I make available as PDF files for the 15 people on our network. I’m able to format and display them without worrying about someone “messing them up” and other users don’t have to need to know how to use LibreOffice in order to read or print the files.

Ah, I seem to have missed an important detail. Actually, we would have no control over the documents. This would be a library setting where other people would come in (both public and associated with us) and these computers are for people who did whatever document creating elsewhere and just came in to print. Though --view looks like it has potential if we can just make that occur in all instances where LibreOffice is opened (like attach it to the command itself, possibly by shortcut?)

If a file is read-only, LibreOffice Writer will open it in read-only mode and will allow printing. (Alas, it will also allow “save as…”.) I suspect similar results could be achieved by using permissions of the operating system to give the public only read permissions to the file (and still allow the owner of the file to update as needed).

Where I last worked one of my tasks was to maintain a document tree for our internal users and we made good use of permissions that allowed just a few of us to edit the directory tree holding the documents and giving read-only access to the staff and read, execute access to the directories themselves, but no write (create) privilege to the staff so people couldn’t accidentally create files or subdirectories in the documentation tree. (I also had a local disc where I would construct the tree and then in off-hours use fastcopy to propagate the changes to the server; fastcopy being the tool I used because it had an option to copy or delete files to make the destination tree look like the source tree without having to copy unchanged files.)

I also noticed that there is a --view {filename} command-line parameter for LibreOffice that can be used for launching LibreOffice and opening the file in read-only mode. This might be an option if the public user sees shortcuts to launch LibreOffice to view the files instead of allowing the public user to actually click (or type in) the name of the file.

If you don’t mind the extra work and the extra disk space, another option is to keep the LibreOffice documents in a private directory and use LibreOffice or other products to export those files to PDF, and make those PDF files available for the public to view & print. The “File” | “Export as PDF…” dialog in LibreOffice Writer includes a “Security” tab where you can give a password and prevent editing of the PDF file but allow printing (you can turn off printing, too). However, even so, in a public-facing computer I would still favor giving the public read-only access to the files and (if needed) read, execute (browse) access to the directory(ies) where the public-facing PDF files are located. Also, by giving the users access to a PDF viewer with the files instead of to command-line-driven LibreOffice, you don’t have to worry about a member of the public doing something that would mess up the LibreOffice profile for the rest of the public.

The community college used Deep Freeze on its lab computers and it would restore the computers to the last “frozen” state when a person logged off so that any changes a person made to that computer would be automatically undone upon logoff. It saved a lot of headaches that could be caused by “creative” students, but it also added a burden of “unfreezing” PCs, get all the approved updates that accumulated, making sure the automatic updates were turned off, and then “refreezing” the machines.