All Projects → zetahernandez → pdf-to-text

zetahernandez / pdf-to-text

Licence: other
Read pdf files on javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pdf-to-text

simple NER
simple rule based named entity recognition
Stars: ✭ 29 (-53.23%)
Mutual labels:  extract-text
covid19-kerala-api-deprecated
Deprecated - A fast API service for retrieving day to day stats about Coronavirus(COVID-19, SARS-CoV-2) outbreak in Kerala(India).
Stars: ✭ 14 (-77.42%)
Mutual labels:  pdftotext
Docotic.Pdf.Samples
C# and VB.NET samples for Docotic.Pdf library
Stars: ✭ 52 (-16.13%)
Mutual labels:  extract-text
unrtf
Wrapper for 'unrtf' utility to extract text from RTF documents
Stars: ✭ 14 (-77.42%)
Mutual labels:  extract-text
pd3f
🏭 PDF text extraction pipeline: self-hosted, local-first, Docker-based
Stars: ✭ 132 (+112.9%)
Mutual labels:  extract-text
pdftron-document-search
Build search across multiple documents client-side in your file storage
Stars: ✭ 33 (-46.77%)
Mutual labels:  extract-text
antiword
R wrapper for antiword utility
Stars: ✭ 47 (-24.19%)
Mutual labels:  extract-text
Iron-OCR-Image-to-Text-in-CSharp
Image to Text Tutorial in C# - See https://ironsoftware.com/csharp/ocr/tutorials/how-to-read-text-from-an-image-in-csharp-net/
Stars: ✭ 65 (+4.84%)
Mutual labels:  pdftotext
pyxpdf
Fast and memory-efficient Python PDF Parser based on xpdf sources
Stars: ✭ 26 (-58.06%)
Mutual labels:  pdftotext

PDF-TO-TEXT

pdf-to-text is a tool to extract text from pdf. for the moment not support ocr scannig to extract text only works for searchable pdf files. This package doesn't have nodejs dependencies.

Build Status

Installation

To install the module. npm install pdf-to-text

You need install the next tools to use this module

  • pdftotext
    • pdftotext is used to extract text out of searchable pdf documents
  • pdfinfo
    • pdfinfo is used to obtain the info of pdf documents

OSX

To begin on OSX, first make sure you have the homebrew package manager installed.

pdftotext is included as part on the xpdf utilities library. xpdf can be installed via homebrew

brew install xpdf

Ubuntu

pdftotext is included in the poppler-utils library. To installer poppler-utils execute

apt-get install poppler-utils

Usage

=======

PDF Info

Obtain info from pdf file

var pdfUtil = require('pdf-to-text');
var pdf_path = "absolute_path/to/pdf_file.pdf";

pdfUtil.info(pdf_path, function(err, info) {
    if (err) throw(err);
    console.log(info);
});

It's retrieve an object with the data info from the pdf file

{ "title": "some title",
  "subject": "TeX output 2003.10.17:1908",
  "author": "Fernando Hernandez",
  "creator": "creator name",
  "producer": "Acrobat Distiller 4.0 for Windows",
  "creationdate": 1066428670000,
  "moddate": 1066428687000,
  "tagged": "no",
  "form": "none",
  "pages": 8,
  "encrypted": "no",
  "page_size": "612 x 792 pts (letter)",
  "file_size": "28695 bytes",
  "optimized": "yes",
  "pdf_version": "1.2" 
  }

PDF Text extract

You can extract text by a range of pages given an option object with from and to properties, or simply omit this option to extract all text from the pdf file

var pdfUtil = require('pdf-to-text');
var pdf_path = "absolute_path/to/pdf_file.pdf";

//option to extract text from page 0 to 10
var option = {from: 0, to: 10};

pdfUtil.pdfToText(pdf_path, option, function(err, data) {
  if (err) throw(err);
  console.log(data); //print text    
});

//Omit option to extract all text from the pdf file
pdfUtil.pdfToText(pdf_path, function(err, data) {
  if (err) throw(err);
  console.log(data); //print all text    
});

Tests

To test that your system satisfies the needed dependencies and that module is functioning correctly execute the command in the pdf-to-text module folder

cd <project_root>/node_modules/pdf-to-text
npm test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].