Clarify redistribution terms and link the license from the README. Co-authored-by: Cursor <cursoragent@cursor.com>
86 lines
2.7 KiB
Markdown
86 lines
2.7 KiB
Markdown
# PDF to DXF Converter
|
|
|
|
Windows desktop app that converts PDF drawings to **DXF** for BricsCAD (and other CAD software), with a live page preview. Optionally saves **DWG** through your installed BricsCAD.
|
|
|
|
**License:** [MIT](LICENSE)
|
|
|
|
## Features
|
|
|
|
- PDF page preview with previous/next navigation
|
|
- Conversion modes: **auto**, **vector**, **vectorize**, **raster**
|
|
- True vector PDFs → editable lines/polylines/text in DXF
|
|
- Flattened / image-only drawing PDFs → traced to editable polylines (`vectorize`)
|
|
- Optional raster underlay mode for scans you want as images
|
|
- Optional DWG export via BricsCAD `SAVEAS`
|
|
|
|
## Requirements
|
|
|
|
- Windows 10/11
|
|
- Python 3.10+ (for development)
|
|
- BricsCAD (optional, only needed for DWG export)
|
|
|
|
## Run from source
|
|
|
|
```powershell
|
|
cd "PDF to DWG converter"
|
|
python -m venv .venv
|
|
.\.venv\Scripts\Activate.ps1
|
|
pip install -r requirements.txt
|
|
python main.py
|
|
```
|
|
|
|
## Build the EXE
|
|
|
|
```powershell
|
|
.\build_exe.ps1
|
|
```
|
|
|
|
Output (share this one file):
|
|
- `dist\PDF_to_DXF.exe` — single EXE, no `_internal` folder to copy
|
|
|
|
On first run it installs into `%LOCALAPPDATA%\PDF_to_DXF\app\`. Later launches reuse that install.
|
|
|
|
## Share with other PCs (no Python needed)
|
|
|
|
1. Send **`PDF_to_DXF.exe`** only
|
|
2. They double-click it (first run shows a short setup into AppData)
|
|
3. Done
|
|
|
|
OCR language data is bundled — no separate Tesseract install.
|
|
Optional only: BricsCAD for DWG save.
|
|
|
|
## Usage
|
|
|
|
1. Click **Open PDF…** and pick a file
|
|
2. Preview pages with ◀ / ▶
|
|
3. Choose mode (`auto` recommended), pages, and scale (1.0 = PDF size; use your own multiplier)
|
|
4. Click **Convert & Save…** — review each page (vector / image / vectorize / skip), then pick the DXF path
|
|
5. Optionally enable **Also save DWG via BricsCAD**
|
|
|
|
### Modes
|
|
|
|
| Mode | Best for | Result |
|
|
|------|----------|--------|
|
|
| `auto` | Mixed PDFs | Native vectors when present; traces image-only drawing pages |
|
|
| `vector` | CAD-exported PDFs | Editable geometry and text (traces if the page is only a bitmap) |
|
|
| `vectorize` | Flattened / printed drawing PDFs | Raster-to-vector polylines (set **Trace detail** to high/maximum) |
|
|
| `raster` | Photos / underlays | Full-page image in the DXF |
|
|
|
|
### BricsCAD DWG
|
|
|
|
If BricsCAD is installed in a standard location, it is detected automatically. To override:
|
|
|
|
```powershell
|
|
$env:BRICSCAD_PATH = "C:\Program Files\Bricsys\BricsCAD V25 en_US\bricscad.exe"
|
|
```
|
|
|
|
## Notes
|
|
|
|
- DXF is the primary format; BricsCAD opens it natively.
|
|
- Scanned pages become image underlays in v1 (not commercial-grade auto-trace).
|
|
- Raster/hybrid conversions write images next to the DXF in a `*_images` folder — keep that folder with the DXF when moving files.
|
|
|
|
## License
|
|
|
|
This project is licensed under the [MIT License](LICENSE).
|