pdf-to-cad
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "pdf-to-cad" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-dc5251bc0f132e8c8d4f7023d23dfbd2910e2797f5cd266cead238fb887cbb73. Verify the upstream source and version against https://skillhub.cn/skills/user_e23943a8/pdf-to-cad before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Convert PDFs (engineering drawings/schematics/blueprints) into layered vector SVG and DXF (compatible with AutoCAD/ZWSOFT/GstarCAD) for downstream CAD or AI drawing workflows. Preserves all vector geometry, text, and raster images, producing clear layers without distortion. Can be invoked via natural language prompts and preserves the input PDF path from the user message (e.g., @-referenced files or pasted paths).
Introduction source: third_party · user_e23943a8 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- |-
- Audience
- Translation pending; see source documentation.
- Inputs and outputs
- The source **PDF path** — usually `@`-referenced in the message or pasted as text. If missing, ask the user for the PDF file. Optional output directory (default: same folder as the PDF).
- Software, accounts and paid services
- Managed Python venv with `pymupdf` + `ezdxf`. Set this up once: If the venv doesn't exist yet, create it first:
- Testing
- Not tested
Browse files
Frontmatter
name: pdf-to-cad
description: |-
Convert a PDF (engineering drawing / schematic / blueprint) into layered
vector SVG and DXF (AutoCAD / 中望 / 浩辰 compatible) for downstream CAD or
AI drawing workflows. Preserves all vector geometry, text, and raster images
with clear layers and no distortion. Invoke with natural-language prompts such
as "将此pdf图纸转化为CAD", "把这份pdf转成dxf", "pdf转矢量图", "pdf to cad",
"pdf to dxf", "convert this pdf drawing to cad". Keep the input PDF path from
the user's message (e.g. via @-referenced file or pasted path).
agent_created: truePDF → CAD (SVG + DXF) Converter
Turn a PDF drawing into two deliverables:
.svg— layered (Inkscape layers: Geometry / Text / Images), 1:1 real-world mm..dxf— DXF R2010, mm units, 4 layers (Geometry / Hatch / Text / Images), imports cleanly into AutoCAD, 中望, 浩辰, LibreCAD, and most AI CAD tools.
When to use
- User says "把这份 PDF 图纸转成 CAD/DXF/矢量图" or equivalent (zh/en).
- User wants editable vector geometry from a PDF (not a raster trace).
- User is prepping a PDF for AI-assisted CAD redraw / parametric editing.
Inputs
- The source PDF path — usually
@-referenced in the message or pasted as text. If missing, ask the user for the PDF file. - Optional output directory (default: same folder as the PDF).
Prerequisites (one-time per environment)
Managed Python venv with pymupdf + ezdxf. Set this up once:
VENV="C:/Users/muxinshu/.workbuddy/binaries/python/envs/default"
PY="$VENV/Scripts/python.exe"
"$VENV/Scripts/pip.exe" install --quiet pymupdf ezdxf
If the venv doesn't exist yet, create it first:
"C:/Users/muxinshu/.workbuddy/binaries/python/versions/3.13.12/python.exe" \
-m venv "$VENV"
Steps
-
Locate the PDF. Read the path from the user message. Resolve to an absolute path.
-
Run the bundled converter (this skill's
convert.py). It does everything: vector SVG export via PyMuPDF, layer reorganization, DXF build via ezdxf, and the critical extents patch.VENV="C:/Users/muxinshu/.workbuddy/binaries/python/envs/default" "$VENV/Scripts/python.exe" \ "C:/Users/muxinshu/.workbuddy/skills/pdf-to-cad/convert.py" \ "ABSOLUTE_PDF_PATH" [--out OUTPUT_DIR] -
Validate (quick). Confirm non-zero entity counts printed at the end (polylines / hatches / texts / images). The script's
DXF extents patchedline must appear — that's what prevents a blank open. -
Report. Tell the user the output paths and the key note below.
Outputs
- base.svg — layered vector, open in Inkscape/Illustrator.
- base.dxf — CAD-ready; must sit in the same folder as base_images/ (29-ish PNGs referenced by relative path). Move both together.
- base_images/ — extracted raster images (photos / renders) referenced by the DXF.
CRITICAL gotchas (why a naive ezdxf export fails)
- Blank-on-open fix: ezdxf's auditor recomputes
$EXTMIN/$EXTMAXonsaveasand fails for docs with many HATCH/IMAGE, resetting them to±1e20. CAD apps frame the initial view from these → blank screen. The script PATCHES the ASCII DXF after save with the real A4-range extents. Never remove that patch. - Chinese font:
doc.styles.add("SimSun", font=...)—font=must be a keyword arg, else the style silently drops and text uses a missing font. - Mirrored images: PyMuPDF emits image transforms with negative determinant
(vertical flip).
add_image(size_in_units, rotation)can't express a mirror, so the script setsu_pixel/v_pixelvectors directly. - Orientation: SVG/PDF are y-DOWN; DXF is y-UP. Flip with
(H_PT - y). Page heightH_PTis read dynamically from the PDF mediabox (don't hardcode). - Inherited paint: fill/stroke are often set on ancestor "g" groups, not the
path.
resolve_paint()walks the ancestor chain; SVG default fill is black. Skip(255,255,255)fills (background) to avoid a black sheet.
Notes
- Vector curves stay exact (Bézier flattened to polylines at 0.25 mm step in DXF).
- Raster photos are embedded as images, NOT traced — they remain raster by nature.
- If the user later reports "DXF blank", re-check the patched extents line first.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决工程图纸 PDF 转可编辑 CAD 矢量格式的高频刚需
- 输出完整闭环(SVG+DXF+图像目录),适用于设计、制造、AI 辅助绘图等场景
Highlights
- 提供中英文多种自然语言触发词,覆盖合理,边界清晰
Areas to improve
-
缺少 When to Use 显式章节标题 Reported severity: Minor
文档中有 'When to use' 内容,但未使用标准二级标题 '## When to Use',而是直接写在正文中,影响结构规范性。
Recommendation: 将 'When to use' 部分改为标准二级标题 '## When to Use',提升文档结构一致性。
-
文档略长 Reported severity: Minor
SKILL.md 内容较为详尽,接近 500 行限制,可能影响可读性。
Recommendation: 考虑将部分技术细节(如 CRITICAL gotchas)移至单独文档或通过折叠块展示,保持主文档简洁。
Highlights
- 结构完整,包含输入、步骤、输出、关键陷阱等必要章节
- 步骤清晰,有端到端示例,frontmatter 完整
Areas to improve
-
硬编码路径导致环境依赖 Reported severity: Major
Prerequisites 和 Steps 中使用了硬编码的 Python venv 路径(C:/Users/muxinshu/.workbuddy/...),不具备跨平台通用性。
Recommendation: 建议将路径改为环境变量或相对路径,或提供配置说明,以增强环境兼容性。
Highlights
- 工具来源明确(pymupdf + ezdxf),参数正确
- 覆盖了关键异常处理(DXF extents 补丁、中文字体、镜像图像、坐标系翻转)
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Managed Python venv with `pymupdf` + `ezdxf`. Set this up once: If the venv doesn't exist yet, create it first:
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.