Office pipe is a command line tool that can be used as a filter (i.e. reads from STDIN and writes to STDOUT) while converting office documents from/to various formats (including PDF) or doing some modifications (set fields/properties, find and replace text, apply stylesheets from a template etc.). This tool is tied to LibreOffice (might work also with OpenOffice) and is fully dependent on it.
Features:
http://
)
This tool is written in C++ and communicates with LibreOffice through the UNO (Universal Network Objects) interface.
Has no dependencies other than the office bundle.
STDIO document reading/writing is done on the client side (in the office-pipe
process).
File or URL reading/writing is done on the server side (in the LibreOffice process).
Convert compressed .ods
spreadsheet to uncompressed (flat) .fods
XML and display it in the console using Relational pipes:
cat "spreadsheet.ods" | office-pipe | relpipe-in-ods | relpipe-out-tabular
Convert a text document to PDF:
cat "document.odt" | office-pipe > "document.pdf"
Apply stylesheet (fonts, colors, header, footer etc.) from a template to a document and save result as PDF:
cat "style.odt" | office-pipe --input-file "doc.odt" --stylesheet-url "stdin:" > "doc.pdf"
Download an office text document, convert it to XHTML and display in the console using the Lynx browser:
office-pipe \
--input-url "https://sane-software.globalcode.info/v_0/ssm.en.fodt" \
--output-property "FilterName" string "XHTML Writer File" \
| lynx -stdin
Bash-completion script, that heavily helps while writing commands, is provided.
Office utilities are free software © 2023 GlobalCode