Code Monkey home page Code Monkey logo

gs_convert's Introduction

gs_convert - converte PDF em TXT

gs_convert.py - script simples em python para a utilização do Ghostscript como conversor de arquivos pdf para arquivo de texto ou imagem.

Requerimentos

Necessário ter instalados:

  • Python 3.x.x
  • Ghostscript 9.53

Se o sofware ghostscript não estiver nas variaveis de ambiente do sistema operacional [PATH], use Ghostscript portável dando a referencia do caminho da pasta onde se encontra o executável do programa:

gs_convet.PORTABLE_ENGINE = 'C:/Users/<username>/Downloads/CommonFiles/Ghostscript/bin/gswin64c'

Como usar

import gs_convert as gs


# chamada opcional para a biblioteca portátil, se você não tiver o ghostscript reconhecido nas variáveis de ambiente [PATH]
gs_portable_path_example = 'C:/Users/<username>/Downloads/CommonFiles/Ghostscript/bin/gswin64c'
gs.PORTABLE_ENGINE = gs_portable_path_example

# declaring output file: convert all pages to a one file
gs.pdf2txt(file_in='files/file.pdf', file_out='files/file.txt')

# omitting output file: convert all pages to separate files
gs.pdf2txt(file_in='files/file.pdf')

# import text from pdf file to string variable
out = gs.pdf2string(file_in='files/file.pdf')
print(out)

Status do projeto

Não terminado - refatorando código e ampliando recursos.

Como contribuir para o projeto

Caso você encontrar um bug Click-aqui crie um issue para eu corrigi-lo. Se estiver interessado em tornar este pacote melhor, sua ajuda é muito bem vinda!

Links

Python

Ghostscript

gs_convert's People

Contributors

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