AI Agent Hub
Back to skills
LibreOffice Document Automation icon

LibreOffice Document Automation

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Install @user_eba395de/libreoffice according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem

Automation workflows often need to move files between Word, Excel, PowerPoint, HTML, and other document formats, but calling soffice directly requires careful handling of headless arguments, filter names, output directories, and batch file expansion. This skill wraps the LibreOffice 24.2 command-line behavior into a more predictable interface for scripts, CI jobs, and local batch processing.

How it works

The core is libreoffice_ops.py, which provides convert, batch, merge, extract-text, and info. convert handles one file, such as Word to PDF; batch processes wildcards such as *.docx; merge combines multiple documents into one output; extract-text pulls text content; and info inspects document metadata. It supports formats including pdf, html, epub, docx, odt, xlsx, ods, pptx, png, jpg, txt, and csv, mapping targets to LibreOffice filter names. Before execution, it checks for a local LibreOffice environment and preserves key parameter ordering such as --headless.

Boundaries and cautions

This skill is best suited for format conversion, batch export, and text extraction. It is not a replacement for GUI-based layout review, macro interaction, or complex proofing. Large files may take time to convert; if --outdir is omitted, output goes to the current directory; wildcard expansion depends on the shell; image conversion may require the target image format to be specified explicitly. Encoding or permission errors should be checked against output directory permissions, file integrity, and filter settings.

Use Cases

  • Export a single Word or ODT file to PDF for archiving and delivery.
  • Convert multiple docx files in a folder to a target format without opening each one.
  • Extract main text from docx or odt files for search, summarization, or indexing.
  • Merge multiple documents in order into one PDF for a complete deliverable.

Best For

  • Administrators or operations staff who need to batch-convert reports and contracts to PDF.
  • Engineers who convert docx and xlsx to txt or csv in scripts for data cleaning.
  • Product or consulting staff who merge multiple documents into one PDF for delivery.
  • Technical support who extracts text from ODT/DOCX files for indexing or knowledge bases.