Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Extract Bengali text from PDFs using OCR.
Install the package:
pip install bangla-pdf-ocr
Install system dependencies:
bangla-pdf-ocr-setup
This command installs tesseract-ocr
, poppler-utils
, and tesseract-ocr-ben
on Linux, or tesseract
, poppler
, and tesseract-lang
on macOS. Windows users should follow the on-screen instructions.
Extract text from the default PDF:
bangla-pdf-ocr
Optional Arguments:
-o
or --output
: Specify the output file path (default is input filename with .txt
extension)-l
or --language
: Specify the OCR language (default is 'ben'
for Bengali)Examples:
Using Default PDF and Output:
bangla-pdf-ocr
This will process Freedom Fight.pdf
and save the extracted text to Freedom Fight.txt
.
Specifying Output File:
bangla-pdf-ocr my_document.pdf -o extracted_text.txt
Specifying OCR Language:
bangla-pdf-ocr my_document.pdf -l eng
You can also use Bangla PDF OCR in your Python scripts:
from bangla_pdf_ocr import ocr
# Extract text from a PDF
extracted_text = ocr.process_pdf('path/to/your/file.pdf', output_file='output.txt', language='ben')
# Print the extracted text
print(extracted_text)
If you encounter any issues:
Ensure Dependencies Are Installed:
Make sure Tesseract and Poppler are properly installed and their directories are in your system's PATH.
For Windows Users:
tessdata
directory contains ben.traineddata
.Check Logs:
Review the console output and logs for any error messages.
Re-run Setup Command:
If dependencies were not installed correctly, try running:
bangla-pdf-ocr-setup
FAQs
A package to extract Bengali text from PDFs using OCR
We found that bangla-pdf-ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.