Skip to content

MIRAautomation/pdf-js-render-extract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

pdf-js-render-extract

#PDF.js Render and Text Extractor

This project demonstrates how to use the PDF.js library to render PDF files in a browser and programmatically extract text content from them. It uses HTML5 <canvas> for rendering and JavaScript to process and display text.

Features

  • Render PDF files in the browser using HTML5 canvas.
  • Extract and display text content from the PDF.
  • Easy-to-use structure for expanding features like multi-page rendering or file uploads.

Getting Started

Prerequisites

  • A web browser that supports HTML5 and JavaScript.
  • The PDF.js library (included in the project via CDN).

Installation

  1. Clone this repository:
    git clone https://github.com/your-username/pdf-js-render-extract.git

Navigate to the project folder: bash Copy code cd pdf-js-render-extract Usage Place a PDF file named example.pdf in the root directory of the project, or update the url variable in the JavaScript file to point to your desired PDF. Open the index.html file in a browser. Project Structure graphql Copy code pdf-js-render-extract/ │ ├── index.html # Main HTML file ├── script.js # JavaScript file for rendering and text extraction └── example.pdf # Sample PDF file (replace with your own) Example When you open the project in a browser:

The PDF will be rendered in a element. Extracted text will be displayed in the "Extracted Text" section below the canvas. Future Enhancements Add support for multi-page PDFs. Enable user-uploaded PDF files. Improve UI/UX for better interaction. Contributing Contributions are welcome! If you have ideas for improvements or additional features, feel free to submit an issue or a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

PDF.js for providing the rendering and text extraction library. markdown Copy code

Customization:

  • Replace your-username with your GitHub username in the repository URL.
  • If you plan to add more features, include them in the Future Enhancements section.

About

pdf-js-render-extract

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published