Giter Club home page Giter Club logo

itt_cnb's Introduction

Preprocesamiento de expendientes

Para el caso de PDFs hechos de scanneres/cámaras, sin anotaciones (e.g. AGN)

Make sure you have installed the following ubuntu/debian packages sudo apt update ; sudo apt install imagemagick poppler-utils rename

  1. Create two directories: Monopagina and Multipagina

  2. Put the multipage PDFs in Multipagina

  3. Create directories for each ls *pdf | sed -e 's/ /_/g' | awk '{print "mkdir \"../Monopagina/" $0 "/\""}' | sed 's/.pdf//g' | bash

  4. Convert ls *pdf | sed 's/.pdf//g' | awk '{print "pdfimages -j \"" $0 ".pdf\" \"../Monopagina/" $0 "/\""'} | bash

  5. Rename ls *pdf | sed 's/.pdf//g' | awk '{print "cd \"../Monopagina/" $0 "\" ; for filename in *.jpg; do mv -- \"$filename\" \"" $0 "_pg$filename\"; done; cd -" }' | bash

5 Put into single folder. If you want all JPEGs to be in a single folder, do: ls *pdf | sed 's/.pdf//g' | awk '{print "cd \"../Monopagina/" $0 "\" ; for filename in *.jpg; do mv -- \"$filename\" ..; done; cd -" }' | bash 5.1 Delete empty folders cd ../Monopagina ; find . -type d -empty -delete

Para el caso de PDFs con índices y anotaciones (e.g. del caso Radilla)

Input:

  1. archivos pdf con muchos documentos y bookmarks por documento
  2. un archivo pdf por cada página (extraido con adobe acrobat)

Prerequisitos:

sudo snap install pdftk

Extraer índice del PDF:

pdftk "Tomo III.pdf" dump_data_^Cf8 > in_III.info

Crear TIFFs del PDF:

Convertir a tiffs

  1. Crear script ls *pdf | awk '{print "convert -density 300 \"" $0 "\" TOMO_II_" $5 ".tiff"}' | sed 's/pdf\.tiff/tiff/g' > convert.sh
  2. Ejecutar script sh convert.sh

Pruebas rápidas de OCR

Instalar tesseract

  1. Los binarios de tesseract :apt-get install tesseract-ocr libtesseract-dev tesseract-ocr-spa
  2. Los paquetes de python pip install -r requirements.txt

itt_cnb's People

Contributors

syats avatar

Watchers

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