LibreOffice Draw
Overview
LibreOffice Draw skill for creating, editing, converting, and automating vector graphics and diagram workflows using the native ODG (OpenDocument Drawing) format.
When to Use This Skill
Use this skill when:
- Creating vector graphics and diagrams in ODG format
- Converting between ODG, SVG, PDF, PNG formats
- Automating diagram and flowchart generation
- Creating technical drawings and schematics
- Batch processing graphics operations
Core Capabilities
1. Graphics Creation
- Create new ODG drawings from scratch
- Generate diagrams from templates
- Create flowcharts and org charts
- Design technical drawings
2. Format Conversion
- ODG to other formats: SVG, PDF, PNG, JPG
- Other formats to ODG: SVG, PDF
- Batch conversion of multiple files
3. Diagram Automation
- Template-based diagram generation
- Automated flowchart creation
- Dynamic shape generation
- Batch diagram production
4. Graphics Manipulation
- Shape creation and manipulation
- Path and bezier curve editing
- Layer management
- Text and label insertion
5. Integration
- Command-line automation via soffice
- Python scripting with UNO
- Integration with workflow tools
Workflows
Creating a New Drawing
Method 1: Command-Line
soffice --draw template.odg
Method 2: Python with UNO
import uno
def create_drawing():
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.drawing.DrawingDocument", ctx)
page = doc.getDrawPages().getByIndex(0)
doc.storeToURL("file:///path/to/drawing.odg", ())
doc.close(True)
Converting Drawings
# ODG to SVG
soffice --headless --convert-to svg drawing.odg
# ODG to PDF
soffice --headless --convert-to pdf drawing.odg
# ODG to PNG
soffice --headless --convert-to png:PNG_drawing drawing.odg
# SVG to ODG
soffice --headless --convert-to odg drawing.svg
# Batch convert
for file in *.odg; do
soffice --headless --convert-to pdf "$file"
done
Format Conversion Reference
Supported Input Formats
Supported Output Formats
- ODG, SVG, PDF, PNG, JPG, GIF, BMP, WMF, EMF
Command-Line Reference
soffice --headless
soffice --headless --convert-to <format> <file>
soffice --draw # Draw
Python Libraries
pip install ezodf # ODF handling
pip install odfpy # ODF manipulation
pip install svgwrite # SVG generation
Best Practices
- Use layers for organization
- Create templates for recurring diagrams
- Use vector formats for scalability
- Name objects for easy reference
- Store ODG source files in version control
- Test conversions thoroughly
- Export to SVG for web use
Troubleshooting
Cannot open socket
killall soffice.bin
soffice --headless --accept="socket,host=localhost,port=8100;urp;"
Quality Issues in PNG Export
soffice --headless --convert-to png:PNG_drawing_Export \
--filterData='{"Width":2048,"Height":2048}' drawing.odg
Resources
Related Skills
- writer
- calc
- impress
- base
- 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 expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: draw3description: Vector graphics and diagram creation, format conversion (ODG/SVG/PDF) with LibreOffice Draw. 4category: Document Processing5source: antigravity6tags: [python, pdf, api, automation, workflow, template, design, document]7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/libreoffice/draw8metadata:9 source: https://skillmd.com/skills/sickn33/draw10---111213# LibreOffice Draw1415## Overview1617LibreOffice Draw skill for creating, editing, converting, and automating vector graphics and diagram workflows using the native ODG (OpenDocument Drawing) format.1819## When to Use This Skill2021Use this skill when:22- Creating vector graphics and diagrams in ODG format23- Converting between ODG, SVG, PDF, PNG formats24- Automating diagram and flowchart generation25- Creating technical drawings and schematics26- Batch processing graphics operations2728## Core Capabilities2930### 1. Graphics Creation31- Create new ODG drawings from scratch32- Generate diagrams from templates33- Create flowcharts and org charts34- Design technical drawings3536### 2. Format Conversion37- ODG to other formats: SVG, PDF, PNG, JPG38- Other formats to ODG: SVG, PDF39- Batch conversion of multiple files4041### 3. Diagram Automation42- Template-based diagram generation43- Automated flowchart creation44- Dynamic shape generation45- Batch diagram production4647### 4. Graphics Manipulation48- Shape creation and manipulation49- Path and bezier curve editing50- Layer management51- Text and label insertion5253### 5. Integration54- Command-line automation via soffice55- Python scripting with UNO56- Integration with workflow tools5758## Workflows5960### Creating a New Drawing6162#### Method 1: Command-Line63```bash64soffice --draw template.odg65```6667#### Method 2: Python with UNO68```python69import uno7071def create_drawing():72 local_ctx = uno.getComponentContext()73 resolver = local_ctx.ServiceManager.createInstanceWithContext(74 "com.sun.star.bridge.UnoUrlResolver", local_ctx75 )76 ctx = resolver.resolve(77 "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"78 )79 smgr = ctx.ServiceManager80 doc = smgr.createInstanceWithContext("com.sun.star.drawing.DrawingDocument", ctx)81 page = doc.getDrawPages().getByIndex(0)82 doc.storeToURL("file:///path/to/drawing.odg", ())83 doc.close(True)84```8586### Converting Drawings8788```bash89# ODG to SVG90soffice --headless --convert-to svg drawing.odg9192# ODG to PDF93soffice --headless --convert-to pdf drawing.odg9495# ODG to PNG96soffice --headless --convert-to png:PNG_drawing drawing.odg9798# SVG to ODG99soffice --headless --convert-to odg drawing.svg100101# Batch convert102for file in *.odg; do103 soffice --headless --convert-to pdf "$file"104done105```106107## Format Conversion Reference108109### Supported Input Formats110- ODG (native), SVG, PDF111112### Supported Output Formats113- ODG, SVG, PDF, PNG, JPG, GIF, BMP, WMF, EMF114115## Command-Line Reference116117```bash118soffice --headless119soffice --headless --convert-to <format> <file>120soffice --draw # Draw121```122123## Python Libraries124125```bash126pip install ezodf # ODF handling127pip install odfpy # ODF manipulation128pip install svgwrite # SVG generation129```130131## Best Practices1321331. Use layers for organization1342. Create templates for recurring diagrams1353. Use vector formats for scalability1364. Name objects for easy reference1375. Store ODG source files in version control1386. Test conversions thoroughly1397. Export to SVG for web use140141## Troubleshooting142143### Cannot open socket144```bash145killall soffice.bin146soffice --headless --accept="socket,host=localhost,port=8100;urp;"147```148149### Quality Issues in PNG Export150```bash151soffice --headless --convert-to png:PNG_drawing_Export \152 --filterData='{"Width":2048,"Height":2048}' drawing.odg153```154155## Resources156157- [LibreOffice Draw Guide](https://documentation.libreoffice.org/)158- [UNO API Reference](https://api.libreoffice.org/)159- [SVG Specification](https://www.w3.org/TR/SVG/)160161## Related Skills162163- writer164- calc165- impress166- base167- workflow-automation168169## Limitations170- Use this skill only when the task clearly matches the scope described above.171- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.172- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.