Coder Social home page Coder Social logo

minku-koo / pdf_table_to_jpg Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 5.13 MB

Extract table from PDF document, Crop and Convert to JPG file

Python 100.00%
pdf-table table-crop pdf-document table-extract camelot pypdf2 pdfminer python3 pdf2jpg pdf2image

pdf_table_to_jpg's Introduction

PDF_Table_to_JPG

Extract table from PDF document, Crop and Convert to JPG file

Table Extract from PDF Document

Crop PDF Table

Convert to JPG File and Save

  • Project Name : PDF Table to JPG

  • Create Date : 19/Nov/2020

  • Update Date : 11/Mar/2021

  • Author : Minku Koo

  • E-Mail : [email protected]

  • Version : 1.2.0

  • Keyword : 'PDF', 'Table', 'Camelot' ,'PDF Extract', 'PYPDF', 'pdf2jpg'


Warning !!

  1. If you get Error message like 'utf-8' encoding~ ,then you should update pdf2jpg library.

    • You can see variable named 'output' in 'pdf2jpg' library

    • You must decode that : output = output.decode() ==> output = output.decode("cp949")

  2. This Project used Camelot Library

경 고 !!

PDF 파일 경로에 한글이 포함되어 있는 경우, 에러가 발생할 수 있습니다.

이럴 경우에는 별도로 pdf2jpg 라이브러리 파일을 열어서

output 변수를 따로 decoding 해주어야 합니다.

기존 output = output.decode() 으로 되어있는 부분을

output = output.decode("cp949") 로 바꾸어주면, 한글 폴더명이 포함되어도 해결됩니다.


Notice

  1. 이 프로젝트는 Camelot를 활용하여 제작되었습니다.
  2. Camelot이 테이블을 추출하는 것이 100% 정확하지 않습니다.
  3. Stream 방식의 경우, Table이 온전히 Crop되지 않습니다. 테이블의 일부가 잘려나갈 수 있습니다.

Example

Original PDF Document

git1

Cropped Table JPG (Lattice Method)

  • table 1 sample-page-2-lattice-crop-3 pdf
  • table 2 sample-page-2-lattice-crop-4 pdf

Cropped Table JPG (Stream Method)

  • table 1 (Failed to detect table) sample-page-2-stream-crop-1 pdf
  • table 2 sample-page-2-stream-crop-2 pdf

pdf_table_to_jpg's People

Contributors

minku-koo avatar

Stargazers

 avatar

Watchers

 avatar  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.