docs

Read, format, and validate DOCX documents using python-docx and soffice.

4|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/AgentbaseHQ/skills --skill docs-agentbasehq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docs
Source: https://github.com/AgentbaseHQ/skills/tree/main/docs
Command: npx skills add https://github.com/AgentbaseHQ/skills --skill docs-agentbasehq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pdf2image, and includes scripts (resource) components.

What problem does it solve?

This Skill provides practical guidance for reading, creating, and reviewing DOCX documents to ensure consistent quality, efficient workflows, and professional output.

Core Features & Use Cases

  • DOCX reading & validation: Step-by-step guidance to inspect layout, style, and content before conversion.
  • Creation with Python tooling: Recommendations for using python-docx to craft structured documents and templates.
  • Conversion & QA workflow: End-to-end steps to convert DOCX to PDF via LibreOffice's soffice and generate page previews for visual review.
  • Use Case: A content team drafts quarterly reports, converts to PDF for distribution, and performs page-image QA to ensure legibility.

Quick Start

  • Install required tooling: Python (with python-docx), LibreOffice (soffice), and Poppler utilities (pdftoppm) or ensure pdf2image is installed.
  • Create or edit a DOCX using python-docx.
  • Convert DOCX to PDF: soffice -env:UserInstallation=file:///tmp/lo_profile_$$ --headless --convert-to pdf --outdir <OUTPUT_DIR> <INPUT_DOCX>
  • Generate page previews: pdftoppm -png <OUTPUT_DIR>/<BASENAME>.pdf <OUTPUT_DIR>/<BASENAME>
  • Open the PNGs to visually inspect pages and iterate until satisfied.

Frequently Asked Questions about docs

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

FAQPage Schema
How do I convert DOCX to PDF using soffice on the command line?

To convert DOCX to PDF, run soffice in headless mode using the --convert-to pdf flag, specifying your output directory and input DOCX file. This command-line approach processes documents efficiently without launching the LibreOffice graphical interface.

Can I use python-docx to create and edit DOCX templates?

Yes, python-docx allows you to programmatically create structured documents and edit DOCX templates. This Python library provides the tooling necessary to craft reports and proposals by manipulating document content and styles directly through code.

What is the best way to visually review a DOCX file after converting it to PDF?

The best way to visually review a converted DOCX file is to generate page previews using pdftoppm or pdf2image. Converting PDF pages to PNG images allows you to inspect layout and legibility iteratively before finalizing the output.

Do I need LibreOffice and Poppler installed to validate DOCX documents?

Yes, validating DOCX documents through this workflow requires LibreOffice (soffice) for PDF conversion and Poppler utilities (pdftoppm) or pdf2image to generate page previews. These tools ensure proper layout inspection and quality assurance.

Why does my DOCX layout break when converting to PDF via soffice?

DOCX layout breaks during soffice PDF conversion often stem from unvalidated styles or unsupported formatting structures. Inspecting the document layout and content before conversion ensures consistency and prevents rendering errors in the final PDF.