# PDF / Image to DXF Converter Windows desktop app that converts PDF and image drawings to **DXF** for BricsCAD (and other CAD software), with a live preview. Optionally saves **DWG** through your installed BricsCAD. **License:** [MIT](LICENSE) ## Features - PDF and image preview (`PNG`, `JPG`, `TIFF`, `BMP`, `GIF`, `WebP`) - Conversion modes: **auto**, **vector**, **vectorize**, **raster** - True vector PDFs → editable lines/polylines/text in DXF - Image files and flattened 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 or Image…** and pick a supported 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` | PDFs and images | Native vectors when present; traces image-only inputs | | `vector` | CAD-exported PDFs | Editable geometry and text (traces if the page is only a bitmap) | | `vectorize` | Images and flattened 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).