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 enprojectnment-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---56# LibreOffice Draw78## Overview910LibreOffice Draw skill for creating, editing, converting, and automating vector graphics and diagram workflows using the native ODG (OpenDocument Drawing) format.1112## When to Use This Skill1314Use this skill when:15- Creating vector graphics and diagrams in ODG format16- Converting between ODG, SVG, PDF, PNG formats17- Automating diagram and flowchart generation18- Creating technical drawings and schematics19- Batch processing graphics operations2021## Core Capabilities2223### 1. Graphics Creation24- Create new ODG drawings from scratch25- Generate diagrams from templates26- Create flowcharts and org charts27- Design technical drawings2829### 2. Format Conversion30- ODG to other formats: SVG, PDF, PNG, JPG31- Other formats to ODG: SVG, PDF32- Batch conversion of multiple files3334### 3. Diagram Automation35- Template-based diagram generation36- Automated flowchart creation37- Dynamic shape generation38- Batch diagram production3940### 4. Graphics Manipulation41- Shape creation and manipulation42- Path and bezier curve editing43- Layer management44- Text and label insertion4546### 5. Integration47- Command-line automation via soffice48- Python scripting with UNO49- Integration with workflow tools5051## Workflows5253### Creating a New Drawing5455#### Method 1: Command-Line56```bash57soffice --draw template.odg58```5960#### Method 2: Python with UNO61```python62import uno6364def create_drawing():65 local_ctx = uno.getComponentContext()66 resolver = local_ctx.ServiceManager.createInstanceWithContext(67 "com.sun.star.bridge.UnoUrlResolver", local_ctx68 )69 ctx = resolver.resolve(70 "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"71 )72 smgr = ctx.ServiceManager73 doc = smgr.createInstanceWithContext("com.sun.star.drawing.DrawingDocument", ctx)74 page = doc.getDrawPages().getByIndex(0)75 doc.storeToURL("file:///path/to/drawing.odg", ())76 doc.close(True)77```7879### Converting Drawings8081```bash82# ODG to SVG83soffice --headless --convert-to svg drawing.odg8485# ODG to PDF86soffice --headless --convert-to pdf drawing.odg8788# ODG to PNG89soffice --headless --convert-to png:PNG_drawing drawing.odg9091# SVG to ODG92soffice --headless --convert-to odg drawing.svg9394# Batch convert95for file in *.odg; do96 soffice --headless --convert-to pdf "$file"97done98```99100## Format Conversion Reference101102### Supported Input Formats103- ODG (native), SVG, PDF104105### Supported Output Formats106- ODG, SVG, PDF, PNG, JPG, GIF, BMP, WMF, EMF107108## Command-Line Reference109110```bash111soffice --headless112soffice --headless --convert-to <format> <file>113soffice --draw # Draw114```115116## Python Libraries117118```bash119pip install ezodf # ODF handling120pip install odfpy # ODF manipulation121pip install svgwrite # SVG generation122```123124## Best Practices1251261. Use layers for organization1272. Create templates for recurring diagrams1283. Use vector formats for scalability1294. Name objects for easy reference1305. Store ODG source files in version control1316. Test conversions thoroughly1327. Export to SVG for web use133134## Troubleshooting135136### Cannot open socket137```bash138killall soffice.bin139soffice --headless --accept="socket,host=localhost,port=8100;urp;"140```141142### Quality Issues in PNG Export143```bash144soffice --headless --convert-to png:PNG_drawing_Export \145 --filterData='{"Width":2048,"Height":2048}' drawing.odg146```147148## Resources149150- [LibreOffice Draw Guide](https://documentation.libreoffice.org/)151- [UNO API Reference](https://api.libreoffice.org/)152- [SVG Specification](https://www.w3.org/TR/SVG/)153154## Related Skills155156- writer157- calc158- impress159- base160- workflow-automation161162## Limitations163- Use this skill only when the task clearly matches the scope described above.164- Do not treat the output as a substitute for enprojectnment-specific validation, testing, or expert review.165- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.