[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-11e8e6a9-f924-48cd-b39b-eec436892ed7":3,"$fG9RKIPsaxUQdlUnVit11rx42JATdZhPgoWxAjskwY-w":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"11e8e6a9-f924-48cd-b39b-eec436892ed7","draw","矢量图形和图表创建，格式转换（ODG\u002FSVG\u002FPDF）使用LibreOffice Draw。","cat_prod_document","mod_productivity","sickn33,productivity","---\nname: draw\ndescription: \"Vector graphics and diagram creation, format conversion (ODG\u002FSVG\u002FPDF) with LibreOffice Draw.\"\ncategory: graphics-processing\nrisk: safe\nsource: personal\ndate_added: \"2026-02-27\"\n---\n\n# LibreOffice Draw\n\n## Overview\n\nLibreOffice Draw skill for creating, editing, converting, and automating vector graphics and diagram workflows using the native ODG (OpenDocument Drawing) format.\n\n## When to Use This Skill\n\nUse this skill when:\n- Creating vector graphics and diagrams in ODG format\n- Converting between ODG, SVG, PDF, PNG formats\n- Automating diagram and flowchart generation\n- Creating technical drawings and schematics\n- Batch processing graphics operations\n\n## Core Capabilities\n\n### 1. Graphics Creation\n- Create new ODG drawings from scratch\n- Generate diagrams from templates\n- Create flowcharts and org charts\n- Design technical drawings\n\n### 2. Format Conversion\n- ODG to other formats: SVG, PDF, PNG, JPG\n- Other formats to ODG: SVG, PDF\n- Batch conversion of multiple files\n\n### 3. Diagram Automation\n- Template-based diagram generation\n- Automated flowchart creation\n- Dynamic shape generation\n- Batch diagram production\n\n### 4. Graphics Manipulation\n- Shape creation and manipulation\n- Path and bezier curve editing\n- Layer management\n- Text and label insertion\n\n### 5. Integration\n- Command-line automation via soffice\n- Python scripting with UNO\n- Integration with workflow tools\n\n## Workflows\n\n### Creating a New Drawing\n\n#### Method 1: Command-Line\n```bash\nsoffice --draw template.odg\n```\n\n#### Method 2: Python with UNO\n```python\nimport uno\n\ndef create_drawing():\n    local_ctx = uno.getComponentContext()\n    resolver = local_ctx.ServiceManager.createInstanceWithContext(\n        \"com.sun.star.bridge.UnoUrlResolver\", local_ctx\n    )\n    ctx = resolver.resolve(\n        \"uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext\"\n    )\n    smgr = ctx.ServiceManager\n    doc = smgr.createInstanceWithContext(\"com.sun.star.drawing.DrawingDocument\", ctx)\n    page = doc.getDrawPages().getByIndex(0)\n    doc.storeToURL(\"file:\u002F\u002F\u002Fpath\u002Fto\u002Fdrawing.odg\", ())\n    doc.close(True)\n```\n\n### Converting Drawings\n\n```bash\n# ODG to SVG\nsoffice --headless --convert-to svg drawing.odg\n\n# ODG to PDF\nsoffice --headless --convert-to pdf drawing.odg\n\n# ODG to PNG\nsoffice --headless --convert-to png:PNG_drawing drawing.odg\n\n# SVG to ODG\nsoffice --headless --convert-to odg drawing.svg\n\n# Batch convert\nfor file in *.odg; do\n    soffice --headless --convert-to pdf \"$file\"\ndone\n```\n\n## Format Conversion Reference\n\n### Supported Input Formats\n- ODG (native), SVG, PDF\n\n### Supported Output Formats\n- ODG, SVG, PDF, PNG, JPG, GIF, BMP, WMF, EMF\n\n## Command-Line Reference\n\n```bash\nsoffice --headless\nsoffice --headless --convert-to \u003Cformat> \u003Cfile>\nsoffice --draw  # Draw\n```\n\n## Python Libraries\n\n```bash\npip install ezodf     # ODF handling\npip install odfpy     # ODF manipulation\npip install svgwrite  # SVG generation\n```\n\n## Best Practices\n\n1. Use layers for organization\n2. Create templates for recurring diagrams\n3. Use vector formats for scalability\n4. Name objects for easy reference\n5. Store ODG source files in version control\n6. Test conversions thoroughly\n7. Export to SVG for web use\n\n## Troubleshooting\n\n### Cannot open socket\n```bash\nkillall soffice.bin\nsoffice --headless --accept=\"socket,host=localhost,port=8100;urp;\"\n```\n\n### Quality Issues in PNG Export\n```bash\nsoffice --headless --convert-to png:PNG_drawing_Export \\\n  --filterData='{\"Width\":2048,\"Height\":2048}' drawing.odg\n```\n\n## Resources\n\n- [LibreOffice Draw Guide](https:\u002F\u002Fdocumentation.libreoffice.org\u002F)\n- [UNO API Reference](https:\u002F\u002Fapi.libreoffice.org\u002F)\n- [SVG Specification](https:\u002F\u002Fwww.w3.org\u002FTR\u002FSVG\u002F)\n\n## Related Skills\n\n- writer\n- calc\n- impress\n- base\n- workflow-automation\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,121,934,"2026-05-16 13:26:07",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"效率工具","productivity","mdi-lightning-bolt-outline","文档处理、数据分析、自动化工作流",4,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"文档处理","document","mdi-file-document-outline","PDF\u002FWord\u002FExcel\u002FPPT 处理",1,23,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"846bc1e6-4954-4bda-a81b-20db699231af","1.0.0","draw.zip",1898,"uploads\u002Fskills\u002F11e8e6a9-f924-48cd-b39b-eec436892ed7\u002Fdraw.zip","374cb83f5f2c5b5ab09e7a00e0abe3e96c419bfe3959d558d2a51378fe03ea26","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4116}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]