Skip to content

BaseMax/pdf-page-size-inspector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PDF Page Size Inspector

A modern, browser-based tool to upload a PDF and analyze comprehensive page dimensions with professional features and a beautiful, responsive interface. Detect page sizes in pixels, points, inches, millimeters, and centimeters, along with orientation, aspect ratio, and standard paper format matching.

This project uses HTML, CSS, JavaScript, and PDF.js to run entirely in the browser with no backend required.

✨ Features

πŸ“€ Upload & Analysis

  • Drag-and-drop support - Simply drag PDF files into the browser
  • File information display - Shows filename, file size, and total pages
  • Real-time analysis - Instant processing with loading indicator
  • Multi-page support - Analyzes every page individually

πŸ“ Comprehensive Measurements

Report sizes in multiple units:

  • Pixels (px) - Screen/digital dimensions
  • Points (pt) - PDF native unit (1/72 inch)
  • Inches (in) - Imperial measurement
  • Millimeters (mm) - Metric measurement
  • Centimeters (cm) - Metric measurement

πŸ“Š Advanced Information

  • Page orientation detection - Portrait, Landscape, or Square
  • Aspect ratio calculation - Shows width:height ratio for each page
  • Paper size matching - Identifies standard formats (A-series, Letter, Legal, Tabloid)
  • Uniformity detection - Indicates if all pages have the same dimensions
  • Statistics summary - Min/max dimensions, most common size, orientation counts

πŸ’Ύ Export & Share

  • Export to CSV - Download analysis results in spreadsheet format
  • Export to JSON - Get structured data for developers
  • Copy to clipboard - Quick copy of results for sharing

🎨 Modern UI/UX

  • Beautiful gradient design - Eye-catching purple/blue gradient theme
  • Card-based layout - Clean, organized information display
  • SVG icons - Crisp, scalable vector graphics
  • Smooth animations - Polished transitions and hover effects
  • Fully responsive - Perfect on mobile, tablet, and desktop
  • Professional table design - Easy-to-read data presentation

πŸš€ Live Demo

Deploy on GitHub Pages or any static hosting provider for instant access.

πŸ“Έ Screenshots

Desktop View

Desktop Interface

Mobile View

Mobile Interface

Tablet View

Tablet Interface

🎯 Getting Started

Prerequisites

This tool runs entirely in the browser. There are no build tools or backend servers required. You only need:

  • A modern web browser (Chrome, Firefox, Edge, Safari)
  • The project files

Installation

  1. Clone the repository:

    git clone https://github.com/BaseMax/pdf-page-size-inspector.git
    cd pdf-page-size-inspector
  2. Open index.html in your browser, or serve it using any static web server:

    # Using Python
    python -m http.server 8080
    
    # Using Node.js
    npx serve
  3. Navigate to http://localhost:8080 in your browser.

Alternatively, you can deploy it on GitHub Pages or any static hosting provider like Netlify or Vercel.

πŸ“– Usage

Basic Usage

  1. Open the app in your browser
  2. Drag and drop a PDF file into the drop zone, or click browse to select a file
  3. Wait for the analysis to complete (loading spinner will appear)
  4. View comprehensive results including:
    • File information (name, size, page count)
    • Detailed page dimensions in all units
    • Orientation and aspect ratio for each page
    • Paper size identification
    • Statistical summary

Export Results

  • CSV Export: Click "Export CSV" to download a spreadsheet with all measurements
  • JSON Export: Click "Export JSON" to get structured data for programmatic use
  • Copy Results: Click "Copy Results" to copy a text summary to your clipboard

Understanding the Results

  • Green summary bar: All pages have uniform dimensions
  • Yellow summary bar: PDF contains pages with varying sizes
  • Statistics section: Shows dimension ranges, most common paper size, and orientation counts

πŸ“„ Supported Paper Sizes

The application automatically identifies these standard paper formats:

ISO A-Series

  • A0 - 841 Γ— 1189 mm (33.1 Γ— 46.8 in)
  • A1 - 594 Γ— 841 mm (23.4 Γ— 33.1 in)
  • A2 - 420 Γ— 594 mm (16.5 Γ— 23.4 in)
  • A3 - 297 Γ— 420 mm (11.7 Γ— 16.5 in)
  • A4 - 210 Γ— 297 mm (8.3 Γ— 11.7 in)
  • A5 - 148 Γ— 210 mm (5.8 Γ— 8.3 in)
  • A6 - 105 Γ— 148 mm (4.1 Γ— 5.8 in)

North American Standards

  • Letter - 216 Γ— 279 mm (8.5 Γ— 11 in)
  • Legal - 216 Γ— 356 mm (8.5 Γ— 14 in)
  • Tabloid - 279 Γ— 432 mm (11 Γ— 17 in)

Pages that don't match standard formats are marked as Custom.

πŸ“ File Structure

pdf-page-size-inspector/
β”œβ”€β”€ index.html         # Main HTML interface with semantic structure
β”œβ”€β”€ style.css          # Modern CSS with responsive design
β”œβ”€β”€ script.js          # Analysis logic and interactive features
β”œβ”€β”€ pdf.min.js         # PDF.js library (Mozilla)
β”œβ”€β”€ pdf.worker.min.js  # PDF.js web worker
β”œβ”€β”€ .gitignore         # Git ignore patterns
β”œβ”€β”€ LICENSE            # MIT License
└── README.md          # This file

πŸ› οΈ Built With

  • HTML5 - Semantic structure with accessibility in mind
  • CSS3 - Modern responsive design with CSS Grid and Flexbox
  • Vanilla JavaScript - No framework dependencies, pure ES6+
  • PDF.js (Mozilla) - Industry-standard PDF parsing and rendering
  • SVG Icons - Crisp, scalable vector graphics

Key Technologies & Features

  • CSS Custom Properties - Dynamic theming with CSS variables
  • CSS Grid & Flexbox - Responsive layouts that adapt to any screen
  • Async/Await - Modern asynchronous JavaScript
  • File API - Browser-native file handling
  • Clipboard API - One-click copy functionality
  • Drag and Drop API - Intuitive file upload experience

🀝 Contributing

Contributions are welcome! Here are some ways you can contribute:

Ideas for Contribution

  • πŸ› Fix bugs or improve error handling
  • 🎨 Enhance UI/UX with new features or improvements
  • πŸ“Š Add support for additional paper formats
  • 🌐 Add internationalization (i18n) support
  • ⚑ Performance optimizations
  • πŸ“± PWA (Progressive Web App) support
  • πŸ”’ Security improvements
  • πŸ“ Documentation improvements
  • β™Ώ Accessibility enhancements

Steps to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Test thoroughly across different browsers and devices
  5. Commit your changes
    git commit -m 'Add some amazing feature'
  6. Push to your branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Please ensure your code follows the existing style and includes appropriate comments.

🌟 Changelog

Version 2.0 (Latest)

  • ✨ Complete UI/UX redesign with modern gradient theme
  • πŸ–±οΈ Drag-and-drop file upload support
  • πŸ“Š Statistics dashboard with detailed metrics
  • πŸ“ Added Points (pt) and Inches (in) measurements
  • πŸ“ Orientation detection (Portrait/Landscape/Square)
  • πŸ“Š Aspect ratio calculation
  • πŸ’Ύ Export to CSV and JSON formats
  • πŸ“‹ Copy results to clipboard
  • πŸ“± Fully responsive design for all devices
  • 🎨 SVG icons throughout the interface
  • ⚑ Loading spinner and better user feedback
  • πŸ“„ File information display (name, size, pages)
  • πŸ“ˆ Enhanced statistics (min/max, most common size, orientation counts)

Version 1.0

  • Basic PDF page size detection
  • Support for multiple measurement units
  • Standard paper size matching
  • Simple table display

πŸ“„ License

This project is released under the MIT License.

Copyright 2025, Seyyed Ali Mohammadiyeh (Max Base)

πŸ™ Acknowledgments

  • PDF.js by Mozilla - Excellent PDF rendering library
  • Contributors - Thank you to all who have contributed to this project

πŸ“§ Contact & Support

Found a bug or have a feature request? Open an issue on GitHub!


Made with ❀️ by Max Base

About

A browser-based tool to upload a PDF and analyze the page dimensions in pixels, millimeters, and centimeters. It also detects whether pages are uniform in size and matches common paper standards such as A3, A4, A5, Letter, etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors