Unoconv headless multiple options, secure PDF


I’m trying to export a PDF that has permissions set so that the PDF cannot be printed, changed, etc but unoconv doesn’t appear to take multiple export options. I’ve tried this, which appears to be accepted but ignored:

unoconv -f pdf -e RestrictPermissions=true -e PermissionPassword=test -e Printing=0 -e Changes=0 -e EnableCopyingOfContent=false tester.doc

I’ve enclosed them in quotes and it complains and ignores the options entirely.

Any ideas?

Or if there is libreoffice -e options I can use instead would be most useful.



This was a genuine issue with unoconv v0.5 that we have fixed in trunk. This fix will be part of the upcoming v0.6 release.

More information from:

Generally, it should work without quotes - just add multiple -e options with a key/value combination. I’ve tested your example with a simple test doc on Ubuntu 10.04 / unoconv 0.4 (manually built, sources from github) / OOo and LO installed. After receiving some segmentation faults, it worked at the third or fourth time i tried.

So, the problem isn’t the syntax. It may be a unoconv problem. You should start checking with unoconv version you’re using. The version that ships with Ubuntu Lucid doesn’t support -e options at all! After verifying that your version supports -e, you could test with simple conversion tasks (no -e option) to check if unoconv works generally. It may be worth the work to build your own unoconv from the github sources.

It doesn’t work here either.

I added debugging code to unoconv and the parameters do seem to be passed to LO, although they don’t seem to have any effect. I can’t generate any sort of protected PDF either.

LO does create a protected PDF when using the dialog in normal mode (not --headless).

Not sure exactly where to look at this point.

Which unoconv version, which OS, which python version? Does your unoconv honor simple, non-security -e options? Which combination of options did you test exactly?

I can confirm that LO 3.6 (mis)behaves in the same way when it is run headless directly from the command line. It completely ignores the last settings in the GUI and defaults its output.

This appears to an LO issue and no problem with unoconv.