This is a PDF parser application built with Next.js that allows users to upload a PDF file and view its extracted text content. The app provides feedback during loading and handles errors to enhance the user experience.
- Upload a PDF file and parse its text content.
- Displays parsed text in a user-friendly format.
- Loading indicator and error alerts for better user experience.
- Node.js (version 14 or later)
- NPM or Yarn
-
Clone the repository:
git clone https://github.com/username/pdf-parser.git cd pdf-parser
-
Install dependencies:
npm install
-
Configure Next.js:
Add the following configuration in
next.config.js
to allowpdf2json
as an external server component package:/** @type {import('next').NextConfig} */ const nextConfig = { experimental: { serverComponentsExternalPackages: ["pdf2json"], }, }; export default nextConfig;
-
Run the application:
npm run dev
-
Access the application:
Open your browser and go to http://localhost:3000.
- On the home page, click Upload PDF to select a PDF file from your computer.
- The system will display a loading bar while parsing the PDF.
- Once parsing is complete, the extracted text content will appear in the "Parsed Data" area.
- If there is an error, an alert will be shown.
- Frontend: Next.js
- PDF Parsing: pdf2json
- Icons and UI Elements: lucide-react, custom styles, shadcn