PDF Generator App
A modern, responsive PDF Generator application built with React and TypeScript that allows users to input their personal details through a beautiful form interface and generate professional PDF documents.
README
PDF Generator App
This PDF Generator App provides a seamless two-screen experience for collecting user information and generating downloadable PDF documents. The application features a clean, professional interface with form validation and real-time PDF preview capabilities.
Key Features
- Interactive Form Interface: Clean, user-friendly form with proper validation
- Real-time Validation: Instant feedback for required fields and format validation
- PDF Preview: Live preview of how the PDF will look before downloading
- Direct Download: Option to download PDF directly from the form or preview screen
- Data Persistence: Form data is preserved when navigating between screens
- Responsive Design: Works seamlessly across desktop, tablet, and mobile devices
- Professional PDF Layout: Clean, formatted PDF output with proper styling
Screen 1: Form Page
- Collects user information through validated input fields
- Required fields: Name, Email, Phone Number
- Optional fields: Position, Description
- Two action buttons: "View PDF" and "Download PDF"
Screen 2: PDF Preview Page
- Displays entered information in a clean, PDF-style layout
- Shows exactly how the final PDF will appear
- Navigation options: "Back" to form and "Download PDF"
๐ ๏ธ Tech Stack
Frontend
- React 18 - Modern React with hooks and functional components
- TypeScript - Type-safe development with enhanced IDE support
- Vite - Fast build tool and development server
- React Router DOM - Client-side routing for navigation
- React Hook Form - Efficient form handling with validation
Styling & UI
- Tailwind CSS - Utility-first CSS framework for rapid styling
- Lucide React - Beautiful, customizable icons
PDF Generation
- jsPDF - Client-side PDF generation library
Development Tools
- ESLint - Code linting and quality assurance
- PostCSS - CSS processing with Autoprefixer
- TypeScript ESLint - TypeScript-specific linting rules
Using the Application
-
Fill the Form
- Enter your personal details in the form
- Required fields are marked with asterisks (*)
- Form validation will guide you through any errors
-
Preview PDF
- Click "View PDF" to see how your PDF will look
- Review all information in the preview screen
-
Download PDF
- Click "Download PDF" from either the form or preview screen
- PDF will be automatically downloaded to your device
Project Structure
src/
โโโ components/ # React components
โ โโโ FormScreen.tsx # Main form interface
โ โโโ PreviewScreen.tsx # PDF preview screen
โโโ types/ # TypeScript type definitions
โ โโโ user.ts # User data interfaces
โโโ utils/ # Utility functions
โ โโโ validation.ts # Form validation logic
โ โโโ pdfGenerator.ts # PDF generation utilities
โโโ App.tsx # Main application component
โโโ main.tsx # Application entry point
โโโ index.css # Global styles
๐ฆ Installation
Prerequisites
- Node.js (version 16 or higher)
- npm or yarn package manager
Steps
-
Clone the repository
git clone https://github.com/codewithdhruba01/PDF-GeneratorWebApp.git cd PDF-GeneratorWebApp -
Install dependencies
npm install -
Start the development server
npm run dev -
Open your browser
Navigate tohttp://localhost:5173to view the application
Running the Application
-
Start Development Server
npm run devThe application will be available at
http://localhost:5173 -
Build for Production
npm run buildCreates an optimized production build in the
distfolder -
Preview Production Build
npm run previewServes the production build locally for testing
๐ License
This project is licensed under the MIT License.
โญ If you find this project useful, please give it a star!
Portfolios -
LinkedIn -
Instagram -
Contact me.
