Document ocr
Extrae texto de PDFs e imágenes usando AWS Textract. Especialmente útil para PDFs de diseño (Illustrator) sin texto extraíble. Trigger en "extraer texto", "OCR", "leer PDF escaneado", "documento sin texto", "Textract".From its SKILL.md
npx -y skills add munolabs/muno-os-plugin --skill document-ocrAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.0 KB, as published. Nobody here has run it
Document OCR
Extrae texto de PDFs e imágenes usando AWS Textract. Útil para documentos escaneados o PDFs de diseño que no tienen texto extraíble.
Archivos en este Skill
document-ocr/
├── SKILL.md
Scripts de referencia (en /scripts/ocr/):
textract_pdf_analyzer.py- Procesar PDFstextract_images_analyzer.py- Procesar imagenes
Prerequisitos
- AWS CLI configurado con credenciales
- Permisos para AWS Textract
- Región:
us-east-1(default) - Python 3.x con boto3
Flujo de Trabajo
Para PDFs
python3 scripts/ocr/textract_pdf_analyzer.py "documento.pdf" "resultado"
Output: Archivos .txt con texto extraido por pagina.
Para Imagenes
python3 scripts/ocr/textract_images_analyzer.py "carpeta_imagenes/" "resultado"
Para PDFs de Illustrator/Diseño
Los PDFs creados en Illustrator o herramientas de diseño frecuentemente no tienen texto extraíble (el texto está como curvas/paths).
Solución: Convertir a imágenes primero
# 1. Convertir PDF a imágenes con ImageMagick
magick -density 300 "archivo.pdf" -quality 100 "output/page.png"
# 2. Procesar imágenes con Textract
python3 scripts/ocr/textract_images_analyzer.py "output/" "resultado"
Gotchas
-
PDFs de diseño: El Read tool de Claude no extrae texto de PDFs de Illustrator. Usar flujo de conversión a imagen + Textract.
-
Límites de Textract:
- Máximo 5MB por documento síncrono
- Para documentos grandes, usar async con S3
-
Calidad de imagen importa: Para mejor OCR, usar density 300 o más al convertir PDF.
-
Tablas: Textract puede detectar tablas, pero el output puede necesitar post-procesamiento.
-
Idioma: Textract funciona mejor con inglés, pero soporta español y otros idiomas.
-
Costos: Textract tiene costo por página. Verificar pricing antes de procesar documentos grandes.
AWS Configuration
Región: us-east-1
Cuenta: [configurar en AWS CLI]
Scripts
textract_pdf_analyzer.py
python3 scripts/ocr/textract_pdf_analyzer.py input.pdf output_prefix
# Envia PDF a Textract, guarda resultado en .txt y .json
# Para PDFs >5MB usa analisis asincrono con S3
textract_images_analyzer.py
python3 scripts/ocr/textract_images_analyzer.py input_folder/ output_prefix
# Procesa todas las imagenes PNG en la carpeta
Output
Archivos de texto plano con el contenido extraído:
resultado_page_1.txtresultado_page_2.txt- etc.
O archivo consolidado:
resultado_full.txt
Alternativas
Si Textract no está disponible:
- Google Cloud Vision API - Similar funcionalidad
- Tesseract - Open source, local, menos preciso
- Adobe Acrobat - Para PDFs con texto oculto