Customizing file formats with unoconv
PDF Export Settings
Unoconv does not import PDF files. However, its settings for PDF export are numerous. The man page gives only a list of settings without a full explanation of any of them. However, a full explanation, as well as valid options for each setting, is available online [4].
As a quick reference, you can also open LibreOffice and click File | Export to PDF to study the options in the PDF dialog window. For instance, on the General tab, the drop-down list of choices for Reduce image resolution shows the valid setting for MaxImageResolution=
. Other options, such as EnableCopyingOfContent=
, can be completed with True or False, or, like Changes
, with 0 for off and 1 for on. With research, you should be able to use many of the available settings. Some, like EmbedStandardFonts
only need to be listed. Each setting should be entered with a separate --export
option, if only to make revision of the command easier.
Some of the most commonly used PDF export settings are listed in Table 1. Their names should make most of their purposes reasonably clear.
Table 1
Common PDF Export Settings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If researching all the settings is more work than you want to undertake – especially for a single operation you are unlikely to repeat – the default filter for PDF export should be acceptable for most purposes.
Graphics Export Settings
Unoconv's graphic support for exporting includes .jpg
, .png
, .gif
, and .eps
file formats, entered in lowercase letters. All these formats support Height
, Width
, and Resolution
settings, making unoconv a convenient way to standardize all the illustrations for an article or a book. In addition, each format supports other settings (Table 2). As with PDF export settings, the man page lists only the settings for graphic formats, leaving you to research valid settings on your own.
Table 2
Unique Settings for Graphic Formats
|
|
|
|
|
|
|
|
The Conversion Toolbox
Unoconv does have a few gaps in its functionality. Its man page lists several specialized scripts that you might need, including asciidoc-odf for converting plain text to the Open Document Format used in LibreOffice and other free office applications [5] and docbook2odf for converting DocBook XML to Open Document Format [6].
However, in many cases, unoconv offers exact imports and exports for common free office formats. It combines the advantages of sensible and easy-to-use defaults with thorough flexibility – if only you take the time to research the possibilities. Especially if you need to do batch file conversions, unoconv remains one of the best hidden utilities in the LibreOffice/OpenOffice toolbox.
Infos
- unoconv: https://github.com/dagwieers/unoconv
- UNO API: https://api.libreoffice.org/
- Standard import and export settings: https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options
- PDF export: http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export
- asciidoc-odf: http://github.com/dagwieers/asciidoc-odf
- docbook2odf: http://open.comsultia.com/docbook2odf/
« Previous 1 2
Buy this article as PDF
(incl. VAT)