GTnos GitHub avatar

pdf-dxf-converter

GTnos

This tool converts PDF drawings (both vector and scanned) to DXF format, offering a GUI for casual users and a CLI for developers.

Stars

3

7-day growth

No data

Forks

1

Open issues

0

License

MIT

Last updated

2026-07-29

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It uniquely handles both vector PDFs and scanned images via automatic detection, and provides a packaged installer for Windows users without requiring Python.

Who it is for

  • Engineers and architects needing to convert CAD-exported PDFs to editable DXF
  • Users digitizing scanned paper drawings into CAD-compatible files
  • Developers who want to integrate PDF-to-DXF conversion into automated workflows

Use cases

  • Convert CAD drawings (e.g., from AutoCAD or Illustrator) to DXF for further editing
  • Digitize scanned blueprints or hand-drawn plans into vector DXF
  • Batch convert multiple PDFs via command line for pipeline or scripting
  • Extract multi-page PDFs into a single DXF with pages arranged side-by-side

Strengths

  • Dual-mode engine automatically selects vector or scan conversion based on PDF content
  • Prepackaged installer (EXE) for Windows users, no Python or dependencies needed
  • Supports both graphical interface and command-line operations for flexibility
  • Open-source under MIT license with full source available to comply with AGPL dependency

Considerations

  • Currently only supports Windows platform
  • Scanned PDFs may produce noisy lines if quality is low; requires good source or high DPI settings
  • Uses PyMuPDF (AGPL-3.0), which may affect commercial redistribution unless source is fully disclosed

README quick start

PDF → DXF 轉換工具

將 PDF 圖面轉換為 DXF 格式(AutoCAD 相容),支援向量 PDF(CAD 軟體輸出)與掃描圖 PDF(紙本掃描)兩種來源,並提供圖形介面與命令列兩種操作方式。

下載與安裝(一般使用者)

  1. Releases 頁面下載最新的 PDF2DXF-Setup.exe
  2. 執行安裝程式,依指示完成安裝
  3. 從開始功能表或桌面捷徑開啟「PDF → DXF 轉換工具」

不需要另外安裝 Python,安裝包已內含所有必要的執行環境與套件。

功能特色

類型說明範例來源
向量模式直接從 PDF 幾何路徑資料抽取線段、曲線、矩形,轉換快速精確AutoCAD、Illustrator 輸出的 PDF
掃描模式PDF 轉點陣圖 → 影像前處理 → 輪廓向量化 → 寫入 DXF掃描機、手機拍照後轉 PDF

程式會自動偵測 PDF 類型,也可手動指定模式。進階設定包含圖層分層方式、重複圖塊偵測(向量模式)、曲線精細度、掃描輪廓簡化精度等。

圖形介面操作

  1. 選擇 PDF 檔案:點選「瀏覽…」選取要轉換的 PDF
  2. 選擇儲存位置(選填):留空則存在與 PDF 相同的資料夾
  3. 選擇模式:自動偵測(推薦)/向量模式/掃描圖模式
  4. 點選「▶ 開始轉換」,完成後自動開啟輸出資料夾

命令列操作(開發者/進階用法)

需先安裝 Python 3.10+ 與相依套件:

pip install -r requirements.txt
# 自動偵測模式
python convert.py 圖面.pdf
python convert.py 圖面.pdf 輸出.dxf
python convert.py 圖面.pdf --dpi 600
python convert.py 圖面.pdf --force-vector
python convert.py 圖面.pdf --force-scan

# 向量 PDF 專用
python pdf_to_dxf.py 圖面.pdf [輸出.dxf]

# 掃描圖 PDF 專用
python scan_to_dxf.py 圖面.pdf [輸出.dxf] [dpi]

多頁 PDF 會合併輸出為一個 DXF 檔案,各頁水平並排排列(間距 20mm),並依所選圖層分層方式分別放在不同圖層。

常見問題

Q:轉換後 DXF 開啟是空白? 可能是向量模式誤判了掃描圖 PDF。請改選「掃描圖模式」再試。

Q:轉換結果線條雜亂? 掃描圖品質不佳時,可嘗試提高 DPI(如 600),或先用影像軟體清理原始掃描圖後再轉換。

Q:多頁 PDF 如何輸出? 多頁 PDF 會合併輸出為一個 DXF 檔案,各頁圖面水平並排排列,每頁間距 20mm,並分別放在不同圖層(PAGE_1PAGE_2…)。

自行打包安裝程式(開發者)

pip install -r requirements.txt
pip install pyinstaller
pyinstaller PDF2DXF.spec

再用 Inno Setup 編譯 installer/setup.iss 產生 PDF2DXF-Setup.exe

授權

本專案原始碼採 MIT License

相依套件另有各自授權,其中 PyMuPDFAGPL-3.0 授權(或商業授權),本專案完整原始碼皆公開於本 repository,以符合 AGPL 對應之原始碼公開要求;其餘相依套件(ezdxf、opencv-python-headless、numpy)皆為 MIT/BSD/Apache 系列寬鬆授權。


made by Claude Code /w Alex YEH

Description

PDF -> DXF 轉換工具:支援向量 PDF 與掃描圖 PDF 轉換為 AutoCAD 相容 DXF

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482