writer

Create, convert, and automate ODT documents with LibreOffice Writer and UNO scripting.

Updated Sep 20, 2024
One-click install
npx skills add https://github.com/AnasIsmai1/dotfiles --skill writer-anasismai1
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: writer
Source: https://github.com/AnasIsmai1/dotfiles/tree/main/claude/.claude/skills/libreoffice/writer
Command: npx skills add https://github.com/AnasIsmai1/dotfiles --skill writer-anasismai1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires odfpy, ezodf.

What problem does it solve? Manually creating, converting, and generating documents at scale is repetitive and error-prone. This Skill automates LibreOffice Writer workflows so you can produce ODT documents, convert between formats like DOCX and PDF, and run mail merges without opening a GUI. ## Core Features & Use Cases - Document Creation & Templating: Generate ODT files from scratch or from templates using Python with UNO or odfpy, including mail merge from CSV or database sources. - Format Conversion: Convert between ODT, DOCX, PDF, HTML, RTF, TXT, and EPUB via headless soffice commands, including batch conversion of entire directories. - Use Case: Imagine you need to send 200 personalized letters as PDFs. Use this Skill to populate a template with data from a CSV file, then batch-convert every generated ODT to PDF in one command. ## Quick Start Ask the assistant to convert the file report.odt to PDF using LibreOffice in headless mode.

Frequently Asked Questions about writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert ODT to PDF from the command line?▼

Run soffice --headless --convert-to pdf document.odt to convert an ODT file to PDF without opening the LibreOffice GUI. For batch conversion, loop over files in a shell for-loop and call the same command on each one.

How do I create ODT documents programmatically in Python?▼

Use the odfpy library to build ODT files by creating an OpenDocumentText object and appending headings and paragraphs, or connect to a running LibreOffice instance via the UNO API for full document control. Both approaches avoid manual GUI interaction.

What formats can LibreOffice Writer convert between?▼

LibreOffice Writer reads ODT, DOCX, DOC, RTF, HTML, TXT, and EPUB, and writes ODT, DOCX, PDF, PDF/A, HTML, RTF, TXT, and EPUB. Conversions run through soffice --headless --convert-to with the target format name.

Why does the UNO socket connection fail in LibreOffice?▼

The connection fails when no LibreOffice instance is listening on the expected port or a stale process blocks it. Kill existing processes with killall soffice.bin, then start a listener with soffice --headless --accept="socket,host=localhost,port=8100;urp;".

What are the limitations of automated ODT to DOCX conversion?▼

Complex layouts, custom styles, and embedded objects may not survive conversion perfectly between ODT and DOCX. Test conversions against representative documents and specify explicit export filters like writer_pdf_Export when output quality matters.