Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pdf-parse2
Advanced tools
Readme
A pure JavaScript, cross-platform module designed for extracting text from PDF files using pdf.js.
npm install pdf-parse2
Or
yarn add pdf-parse2
const fs = require('fs');
const PDFParse = require('pdf-parse2');
(async () => {
const dataBuffer = fs.readFileSync('path/to/your/document.pdf');
const PDFParse = new PDFParse();
try {
const pdfData = await PDFParse.loadPDF(dataBuffer);
console.log('Text:', pdfData.text);
} catch (error) {
console.error(error);
}
})();
Ensure you include pdf.js library in your project. You can then use PDFParse
similar to the Node.js example, but with fetching the PDF file using Fetch API or XMLHttpRequest.
loadPDF(src, options)
: Loads a PDF file and extracts text. src
can be a Buffer
or ArrayBuffer
. options
is optional.
renderPage(pageData, options)
: A helper function for rendering a single page. This function is used internally by loadPDF
.
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for any bugs or feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A pure JavaScript, cross-platform module designed for extracting text from PDF files.
The npm package pdf-parse2 receives a total of 20 weekly downloads. As such, pdf-parse2 popularity was classified as not popular.
We found that pdf-parse2 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.