AI Agent Hub
Back to skills
PDF to CAD Converter icon

PDF to CAD Converter

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Install @user_e23943a8/pdf-to-cad according to https://skillhub.cn/install/skillhub.md.

About this skill

The Problem

Many PDF drawings can be imported into CAD, but the result is often unusable: geometry, text, hatches, and images are mixed, or the DXF extents are wrong and the drawing opens blank. pdf-to-cad aims to produce two engineering-ready files: base.svg and base.dxf, so designers can continue work in Inkscape, Illustrator, AutoCAD, ZWCAD, GCAD, LibreCAD, and similar tools.

How It Works

The skill resolves the PDF path from the user message and runs the bundled convert.py. It uses PyMuPDF to extract vector geometry, text, images, and layer information, then rebuilds a layered SVG with a Geometry / Text / Images structure. It also uses ezdxf to generate a DXF R2010 file in mm units, organized into Geometry / Hatch / Text / Images layers.

Key handling includes:
- Curve discretization: Béziers are flattened to polylines at a 0.25 mm step in DXF while keeping geometry editable.
- Axis correction: PDF/SVG coordinates are y-down while DXF is y-up, so the script flips coordinates using the PDF mediabox height.
- Images and paint: raster photos remain as PNG references in base_images/ instead of being traced; fill colors are resolved from SVG ancestor nodes to avoid turning white backgrounds into black shapes.
- Extents patch: the script repairs abnormal $EXTMIN/$EXTMAX values after saving to prevent blank initial views in CAD.

Scope And Caveats

Use it when you need editable vector geometry from a PDF drawing, or when preparing a PDF for AI-assisted redraw and parametric editing. Keep base.dxf in the same folder as base_images/, otherwise relative image paths break. If the source PDF is a scanned raster, the output is still an editable vector framework plus raster images, not magically accurate CAD entities.

Use Cases

  • Mechanical designers receive supplier PDF drawings and need DXF output to edit lines and dimensions in AutoCAD.
  • Product engineers convert PDFs into layered SVG and DXF files for AI-assisted redraw or parametric editing.
  • CAD drafters open base.dxf in ZWCAD or GCAD and check whether geometry, text, hatches, and images are layered.
  • Draft administrators process PDF archives while keeping raster photos as relative references to base_images.

Best For

  • Mechanical designers: convert supplier PDF drawings into editable DXF files for annotation and dimension changes.
  • Product engineers: extract layered vectors and DXF from PDFs for AI-assisted redraw or parametric modeling.
  • CAD drafters: import PDF drawings into ZWCAD, GCAD, or AutoCAD for continued drafting.
  • Draft administrators: organize PDF archives and output DXF packages with base_images references.