Inspect, edit, and export CorelDRAW CDR files via COM automation.
编程
CorelDRAW Exporter
试用Inspect and export objects from CorelDRAW CDR files via COM automation.
它能做什么
Inspect and export objects from CorelDRAW CDR files via COM automation.
技能文档
CorelDRAW Exporter
Use this skill to inspect .cdr files and export specific CorelDRAW content through the installed CorelDRAW application instead of attempting to parse the proprietary CDR format directly.
Requirements
- Windows with CorelDRAW installed and registered for automation, usually
CorelDRAW.ApplicationorCorelDRAW.Application.. - Python 3.9+.
pywin32available in the Python environment. If it is missing and the user allows local package installation, runpy -3 -m pip install --user pywin32.- Optional: ImageMagick for contact sheets and post-export trimming/compositing.
Safety
- Preserve the source
.cdr; export derived files only unless the user explicitly asks for edits. - Do not overwrite existing exports unless the user requested it or you are writing to a fresh output folder. Prefer a manifest so exports are traceable.
- For public/shareable output, avoid embedding local machine paths, private usernames, or proprietary project notes in the skill or exported metadata.
- CorelDRAW may open a GUI window during automation. Close it with
app.Quit()infinallyblocks.
Workflow
- Confirm the input
.cdrexists and choose an output directory. - Inspect the document before exporting:
- Run
scripts/coreldraw_export.py inspect --json. - Review pages, layers, top-level shape indexes, names, types, positions, and dimensions.
- Export a page preview if object names are missing:
scripts/coreldraw_export.py preview --page 1 --dpi 300.
- Run
- Decide export specs:
- Use one-based shape indexes from inspection.
- Use ranges for multi-shape clusters, e.g.
7-20. - Use comma lists for non-contiguous clusters, e.g.
2,5,8-10. - Prefer semantic filenames from visual/content context, e.g.
birch_summer_01.png,logo_primary.svg.
- Export selected content:
- Single objects:
scripts/coreldraw_export.py export --item tree_01.png:4. - Multi-object clusters:
scripts/coreldraw_export.py export --item tree_cluster.png:7-20. - Multiple outputs: pass
--itemrepeatedly. - Full layer/page fallback: use
--all-top-levelorpreviewwhen exact object grouping is unclear.
- Single objects:
- Validate the result:
- Check file count and byte sizes.
- For PNGs, verify alpha with ImageMagick if available:
magick identify -format "%f %[channels] %[pixel:p{0,0}] %wx%h\n". - Create a contact sheet when many assets were exported:
magick montage -thumbnail 180x180 -set label "%t".
- Report what was exported, where, naming assumptions, and any ambiguous objects skipped.
Notes
- CorelDRAW shape
Typevalues are numeric in COM output; use them mainly for filtering/recon, not as the only semantic signal. - Many CDRs have unnamed objects. In that case, use visual page previews plus coordinates and object ordering.
- Exporting a selection usually crops to the selected object/range bounds. Complex effects, lenses, transparencies, or fonts may rasterize or render differently depending on the export format.
- If generic converters such as ImageMagick, Inkscape, or LibreOffice fail on CDR, keep using CorelDRAW COM. It is the most reliable path when CorelDRAW is installed.
相关技能
Turn images into editable business documents.
All-in-one PDF workflow for document tasks.
Convert drawio/diagrams.net flowchart and diagram files into self-contained HTML pages with embedded SVG rendering. Use when the user uploads or mentions a .drawio file and wants to convert it to HTML, view it in a browser, or share it as a web page. Triggers on phrases like "drawio转html", "流程图转网页",
Turn Word documents into polished PDFs.
Convert documents and data files to PDF.