Skip to content
writer logo

LibreOffice Writer

writer

Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.

ranbot-ai/awesome-skills0installs6stars

SKILL.md

Full skill instructions

LibreOffice Writer

Overview

LibreOffice Writer skill for creating, editing, converting, and automating document workflows using the native ODT (OpenDocument Text) format.

When to Use This Skill

Use this skill when:

  • Creating new documents in ODT format
  • Converting documents between formats (ODT <-> DOCX, PDF, HTML, RTF, TXT)
  • Automating document generation workflows
  • Performing batch document operations
  • Creating templates and standardized document formats

Core Capabilities

1. Document Creation

  • Create new ODT documents from scratch
  • Generate documents from templates
  • Create mail merge documents
  • Build forms with fillable fields

2. Format Conversion

  • ODT to other formats: DOCX, PDF, HTML, RTF, TXT, EPUB
  • Other formats to ODT: DOCX, DOC, RTF, HTML, TXT
  • Batch conversion of multiple documents

3. Document Automation

  • Template-based document generation
  • Mail merge with data sources (CSV, spreadsheet, database)
  • Batch document processing
  • Automated report generation

4. Content Manipulation

  • Text extraction and insertion
  • Style management and application
  • Table creation and manipulation
  • Header/​footer management

5. Integration

  • Command-line automation via soffice
  • Python scripting with UNO
  • Integration with workflow automation tools

Workflows

Creating a New Document

Method 1: Command-Line
soffice --writer template.odt
Method 2: Python with UNO
import uno

def create_document():
    local_ctx = uno.getComponentContext()
    resolver = local_ctx.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", local_ctx
    )
    ctx = resolver.resolve(
        "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"
    )
    smgr = ctx.ServiceManager
    doc = smgr.createInstanceWithContext("com.sun.star.text.TextDocument", ctx)
    text = doc.Text
    cursor = text.createTextCursor()
    text.insertString(cursor, "Hello from LibreOffice Writer!", 0)
    doc.storeToURL("file:///path/​to/​document.odt", ())
    doc.close(True)
Method 3: Using odfpy
from odf.opendocument import OpenDocumentText
from odf.text import P, H

doc = OpenDocumentText()
h1 = H(outlinelevel='1', text='Document Title')
doc.text.appendChild(h1)
doc.save("document.odt")

Converting Documents

# ODT to DOCX
soffice --headless --convert-to docx document.odt

# ODT to PDF
soffice --headless --convert-to pdf document.odt

# DOCX to ODT
soffice --headless --convert-to odt document.docx

# Batch convert
for file in *.odt; do
    soffice --headless --convert-to pdf "$file"
done

Template-Based Generation

import subprocess
import tempfile
from pathlib import Path

def generate_from_template(template_path, variables, output_path):
    with tempfile.TemporaryDirectory() as tmpdir:
        subprocess.run(['unzip', '-q', template_path, '-d', tmpdir])
        content_file = Path(tmpdir) / 'content.xml'
        content = content_file.read_text()
        for key, value in variables.items():
            content = content.replace(f'${{{key}}}', str(value))
        content_file.write_text(content)
        subprocess.run(['zip', '-rq', output_path, '.'], cwd=tmpdir)
    return output_path

Format Conversion Reference

Supported Input Formats

  • ODT (native), DOCX, DOC, RTF, HTML, TXT, EPUB

Supported Output Formats

  • ODT, DOCX, PDF, PDF/​A, HTML, RTF, TXT, EPUB

Command-Line Reference

soffice --headless
soffice --headless --convert-to <format> <file>
soffice --writer    # Writer
soffice --calc      # Calc
soffice --impress   # Impress
soffice --draw      # Draw

Python Libraries

pip install odfpy     # ODF manipulation
pip install ezodf     # Easier ODF handling

Best Practices

  1. Use styles for consistency
  2. Create templates for recurring documents
  3. Ensure accessibility (heading hierarchy, alt text)
  4. Fill document metadata
  5. Store ODT source files in version control
  6. Test conversions thoroughly
  7. Embed fonts for PDF distribution
  8. Handle conversion failures gracefully
  9. Log automation operations
  10. Clean temporary files

Troubleshooting

Cannot open socket

killall soffice.bin
soffice --headless --accept="socket,host=localhost,port=8100;urp;"

Conversion Quality Issues

soffice --headless --convert-to pdf:writer_pdf_Export document.odt

Resources

Related Skills

  • calc
  • impress
  • draw
  • base
  • docx-official
  • pdf-official
  • workflow-automation

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or exp

More skills from ranbot-ai

react-modernization logo
ranbot-ai/awesome-skills

react-modernization

Master React version upgrades, class to hooks migration, concurrent features adoption, and codemods for automated transformation.

6 1
View
cicd-automation-workflow-automate logo
ranbot-ai/awesome-skills

cicd-automation-workflow-automate

You are a workflow automation expert specializing in creating efficient CI/CD pipelines, GitHub Actions workflows, and automated development processes. Design and implement automation that reduces man

6 1
View
conductor-manage logo
ranbot-ai/awesome-skills

conductor-manage

Manage track lifecycle: archive, restore, delete, rename, and cleanup

6 0
View
c-pro logo
ranbot-ai/awesome-skills

c-pro

Write efficient C code with proper memory management, pointer

6 0
View
clerk-auth logo
ranbot-ai/awesome-skills

clerk-auth

Expert patterns for Clerk auth implementation, middleware, organizations, webhooks, and user sync

6 0
View
mezmo-automation logo
ranbot-ai/awesome-skills

mezmo-automation

Automate Mezmo tasks via Rube MCP (Composio). Always search tools first for current schemas.

6 0
View
fp-types-ref logo
ranbot-ai/awesome-skills

fp-types-ref

Quick reference for fp-ts types. Use when user asks which type to use, needs Option/Either/Task decision help, or wants fp-ts imports.

6 0
View
google-calendar-automation logo
ranbot-ai/awesome-skills

google-calendar-automation

Lightweight Google Calendar integration with standalone OAuth authentication. No MCP server required.

6 0
View
scala-pro logo
ranbot-ai/awesome-skills

scala-pro

Master enterprise-grade Scala development with functional programming, distributed systems, and big data processing. Expert in Apache Pekko, Akka, Spark, ZIO/Cats Effect, and reactive architectures.

6 0
View
python-development-python-scaffold logo
ranbot-ai/awesome-skills

python-development-python-scaffold

You are a Python project architecture expert specializing in scaffolding production-ready Python applications. Generate complete project structures with modern tooling (uv, FastAPI, Django), type hint

6 0
View
onedesk-automation logo
ranbot-ai/awesome-skills

onedesk-automation

Automate Onedesk tasks via Rube MCP (Composio). Always search tools first for current schemas.

6 0
View
googlecalendar-automation logo
ranbot-ai/awesome-skills

googlecalendar-automation

Automate Google Calendar tasks via Rube MCP (Composio). Always search tools first for current schemas.

6 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View