Install
openclaw skills install document-generatorGenerate professional Word, Excel, and PDF documents with rich formatting, tables, images, and layouts. Use this skill whenever the user mentions creating documents, generating reports, exporting to DOCX/XLSX/PDF, making spreadsheets, building presentations in document form, or needs any kind of formatted document output. This includes requests like "create a report", "generate an Excel file", "export to PDF", "make a Word document", "build a spreadsheet", or even indirect mentions like "I need this data in a table" or "format this as a document".
openclaw skills install document-generatorGenerate professional Word (.docx), Excel (.xlsx), and PDF documents with comprehensive formatting support including fonts, colors, tables, images, layouts, and more.
Use this skill when the user needs to:
Ask clarifying questions if needed:
The skill provides three main scripts in the scripts/ directory:
generate_word.py - For Word documentsgenerate_excel.py - For Excel spreadsheetsgenerate_pdf.py - For PDF documentsEach script accepts a JSON configuration that describes the document structure and content.
Create a JSON configuration file that describes the document. The structure varies by document type - see the reference files for detailed schemas:
references/word_schema.md - Word document configurationreferences/excel_schema.md - Excel spreadsheet configurationreferences/pdf_schema.md - PDF document configurationRun the appropriate script with the configuration:
python document-generator/scripts/generate_word.py config.json output.docx
python document-generator/scripts/generate_excel.py config.json output.xlsx
python document-generator/scripts/generate_pdf.py config.json output.pdf
Check the generated document and make adjustments to the configuration if needed.
All three document types support template-based generation:
To use a template, include a template field in your configuration pointing to the template file path.
{
"page_setup": {
"margins": {"top": 1, "bottom": 1, "left": 1, "right": 1}
},
"content": [
{
"type": "heading",
"text": "Monthly Report",
"level": 1
},
{
"type": "paragraph",
"text": "This is the report content.",
"font": {"name": "Arial", "size": 11}
}
]
}
{
"sheets": [
{
"name": "Sales Data",
"data": [
["Product", "Quantity", "Price", "Total"],
["Widget A", 10, 25.50, "=B2*C2"],
["Widget B", 5, 30.00, "=B3*C3"]
],
"formatting": {
"header_row": 0,
"column_widths": [15, 10, 10, 10]
}
}
]
}
{
"page_setup": {
"size": "A4",
"margins": {"top": 20, "bottom": 20, "left": 20, "right": 20}
},
"content": [
{
"type": "text",
"text": "Invoice #12345",
"font": {"name": "Helvetica-Bold", "size": 18}
},
{
"type": "paragraph",
"text": "Thank you for your business.",
"font": {"name": "Helvetica", "size": 12}
}
]
}
Missing Dependencies: If scripts fail, ensure required Python packages are installed:
pip install python-docx openpyxl reportlab Pillow
Font Issues: If custom fonts don't work, verify the font name is correct and available on the system.
Image Problems: Ensure image paths are absolute or relative to the script execution directory.
Excel Formulas: Use Excel formula syntax (e.g., =SUM(A1:A10)) as strings in the data array.
For complex documents, refer to the detailed reference files:
references/word_schema.md - Complete Word configuration optionsreferences/excel_schema.md - Complete Excel configuration optionsreferences/pdf_schema.md - Complete PDF configuration optionsThese references include examples of: