Git Product home page Git Product logo

pypdftodxf's Introduction

pyPDFtoDXF

Quick and dirty script to pull vector graphics from a PDF and export to DXF drawing files.

System Requirements:

inkscape pdf2svg

!!!! Requires 'inkscape' and 'pdf2svg' to be in system path !!!!

Python Requirements:

pip install PyPDF2

Script is just gluing together pdf2svg to make a svg, and then inkscape processes the svg to a dxf. Saves the svg in output folder along with dxf. Note that this can be slow if your PDF has many, many pages to go thru as the inscape process has to be called once-per-page. Better to extract just a single page or range of pages instead if that is all you need (see input args).

Also this method has trouble with converting certain types of text in PDFs into DXF.
It works mainly for polys and other vectors, e.g. drawings that were originally CAD or SVG and saved into PDF.

Example Usage:

python pdftodxf.py input.pdf output

%% takes all pages of file named input.pdf and saves svgs and dxfs into folder named output

python PDFtoDXF.py input.pdf output -p 3,4

%% takes just pages 3 and 4 of input.pdf and saves svgs and dxfs into folder named output

pypdftodxf's People

Contributors

mjecke avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.