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.4---567# LibreOffice Draw89## Overview1011LibreOffice Draw skill for creating, editing, converting, and automating vector graphics and diagram workflows using the native ODG (OpenDocument Drawing) format.1213## When to Use This Skill1415Use this skill when:16- Creating vector graphics and diagrams in ODG format17- Converting between ODG, SVG, PDF, PNG formats18- Automating diagram and flowchart generation19- Creating technical drawings and schematics20- Batch processing graphics operations2122## Core Capabilities2324### 1. Graphics Creation25- Create new ODG drawings from scratch26- Generate diagrams from templates27- Create flowcharts and org charts28- Design technical drawings2930### 2. Format Conversion31- ODG to other formats: SVG, PDF, PNG, JPG32- Other formats to ODG: SVG, PDF33- Batch conversion of multiple files3435### 3. Diagram Automation36- Template-based diagram generation37- Automated flowchart creation38- Dynamic shape generation39- Batch diagram production4041### 4. Graphics Manipulation42- Shape creation and manipulation43- Path and bezier curve editing44- Layer management45- Text and label insertion4647### 5. Integration48- Command-line automation via soffice49- Python scripting with UNO50- Integration with workflow tools5152## Workflows5354### Creating a New Drawing5556#### Method 1: Command-Line57```bash58soffice --draw template.odg59```6061#### Method 2: Python with UNO62```python63import uno6465def create_drawing():66 local_ctx = uno.getComponentContext()67 resolver = local_ctx.ServiceManager.createInstanceWithContext(68 "com.sun.star.bridge.UnoUrlResolver", local_ctx69 )70 ctx = resolver.resolve(71 "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"72 )73 smgr = ctx.ServiceManager74 doc = smgr.createInstanceWithContext("com.sun.star.drawing.DrawingDocument", ctx)75 page = doc.getDrawPages().getByIndex(0)76 doc.storeToURL("file:///path/to/drawing.odg", ())77 doc.close(True)78```7980### Converting Drawings8182```bash83# ODG to SVG84soffice --headless --convert-to svg drawing.odg8586# ODG to PDF87soffice --headless --convert-to pdf drawing.odg8889# ODG to PNG90soffice --headless --convert-to png:PNG_drawing drawing.odg9192# SVG to ODG93soffice --headless --convert-to odg drawing.svg9495# Batch convert96for file in *.odg; do97 soffice --headless --convert-to pdf "$file"98done99```100101## Format Conversion Reference102103### Supported Input Formats104- ODG (native), SVG, PDF105106### Supported Output Formats107- ODG, SVG, PDF, PNG, JPG, GIF, BMP, WMF, EMF108109## Command-Line Reference110111```bash112soffice --headless113soffice --headless --convert-to <format> <file>114soffice --draw # Draw115```116117## Python Libraries118119```bash120pip install ezodf # ODF handling121pip install odfpy # ODF manipulation122pip install svgwrite # SVG generation123```124125## Best Practices1261271. Use layers for organization1282. Create templates for recurring diagrams1293. Use vector formats for scalability1304. Name objects for easy reference1315. Store ODG source files in version control1326. Test conversions thoroughly1337. Export to SVG for web use134135## Troubleshooting136137### Cannot open socket138```bash139killall soffice.bin140soffice --headless --accept="socket,host=localhost,port=8100;urp;"141```142143### Quality Issues in PNG Export144```bash145soffice --headless --convert-to png:PNG_drawing_Export \146 --filterData='{"Width":2048,"Height":2048}' drawing.odg147```148149## Resources150151- [LibreOffice Draw Guide](https://documentation.libreoffice.org/)152- [UNO API Reference](https://api.libreoffice.org/)153- [SVG Specification](https://www.w3.org/TR/SVG/)154155## Related Skills156157- writer158- calc159- impress160- base161- workflow-automation162163## Limitations164- Use this skill only when the task clearly matches the scope described above.165- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.166- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.