npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pdf-smaller

v1.0.0

Published

Free online PDF compression tool with drag and drop functionality

Readme

PDF Smaller - Free Online PDF Compressor

A modern, responsive web application for compressing PDF files with drag-and-drop functionality. Built with vanilla JavaScript and optimized for SEO and ad placement.

🚀 Features

  • Drag & Drop Interface: Easy file upload with visual feedback
  • Batch Processing: Compress single or multiple PDF files simultaneously
  • Compression Options: Choose from Low, Medium, or High compression levels
  • Client-Side Processing: All compression happens in your browser - no files uploaded to servers
  • Responsive Design: Works perfectly on desktop, tablet, and mobile devices
  • SEO Optimized: Structured data, meta tags, and semantic HTML
  • Ad-Friendly Layout: Strategic placement areas for maximum ad revenue
  • Progressive Web App: Installable with offline capabilities
  • Performance Optimized: Fast loading and efficient processing

🛠️ Technology Stack

  • Frontend: HTML5, CSS3, JavaScript (ES6+)
  • PDF Processing: PDF-lib - Client-side PDF manipulation
  • Styling: Custom CSS with CSS Grid and Flexbox
  • PWA: Service Worker, Web App Manifest
  • SEO: Structured Data (JSON-LD), Open Graph, Twitter Cards

📁 Project Structure

pdfsmaller/
├── index.html              # Main HTML file
├── styles.css              # CSS styles and responsive design
├── script.js               # JavaScript application logic
├── sw.js                   # Service Worker for PWA
├── site.webmanifest        # Web App Manifest
├── robots.txt              # SEO robots file
├── .github/
│   └── copilot-instructions.md
└── README.md

🎨 Design Features

Responsive Layout

  • Mobile-first design approach
  • CSS Grid for main layout structure
  • Flexbox for component alignment
  • Optimized for all screen sizes

Ad Placement Areas

  • Header Banner: 728x90 or 970x90 leaderboard
  • Sidebar Ads: 160x600 skyscraper or 300x250 medium rectangle
  • Content Ads: 300x250 or 728x90 between sections
  • Footer Banner: 728x90 leaderboard
  • Mobile Optimized: Responsive ad units

Color Scheme

  • Primary: Linear gradient (#667eea to #764ba2)
  • Background: White with subtle shadows
  • Text: #333 (dark gray) for readability
  • Accents: Green for success, red for errors

🔧 How It Works

  1. File Selection: Users can drag & drop PDF files or click to select
  2. Validation: Files are validated for type (PDF) and size (max 50MB)
  3. Compression Options: Users choose compression level
  4. Processing: PDF-lib processes files client-side
  5. Results: Shows original vs compressed sizes with download options

📊 SEO Optimization

Meta Tags

  • Title: "PDF Smaller - Free Online PDF Compressor Tool"
  • Description: Optimized for search engines
  • Keywords: Relevant PDF compression terms
  • Open Graph and Twitter Card support

Structured Data

  • WebApplication schema
  • Proper heading hierarchy
  • Semantic HTML structure
  • Alt text for images (when added)

Performance

  • Optimized loading speed
  • Core Web Vitals compliance
  • Efficient resource loading
  • Proper caching headers

🚀 Getting Started

Prerequisites

  • Modern web browser with JavaScript enabled
  • Web server (for testing locally)

Local Development

  1. Clone or download the project files
  2. Serve the files using a local web server:
    # Using Python 3
    python -m http.server 8000
       
    # Using Node.js (http-server)
    npx http-server
       
    # Using PHP
    php -S localhost:8000
  3. Open http://localhost:8000 in your browser

Production Deployment

Using Cloudflare Pages

  1. Connect your repository to Cloudflare Pages
  2. Build settings:
    • Build command: echo 'Static site - no build required'
    • Build output directory: /
  3. Configure custom domain (pdfsmaller.com)
  4. Enable HTTPS (automatic with Cloudflare)
  5. Set up analytics (Google Analytics, Cloudflare Analytics, etc.)
  6. Configure ad networks (Google AdSense, etc.)
  7. Submit sitemap to search engines

Alternative Deployment Options

  1. Upload files to any web server
  2. Configure HTTPS (required for PWA features)
  3. Set up analytics and ad networks
  4. Submit sitemap to search engines

🔧 Customization

Adding Analytics

Replace the placeholder in script.js:

// Example Google Analytics 4 implementation:
gtag('event', eventName, properties);

Configuring Ads

Replace ad placeholders in index.html with actual ad code:

<div class="ad-space ad-header" id="header-ad">
    <!-- Replace with actual ad code -->
</div>

Customizing Compression

Modify compression settings in script.js:

const compressionSettings = {
    low: { imageQuality: 0.8, removeMetadata: false },
    medium: { imageQuality: 0.6, removeMetadata: true },
    high: { imageQuality: 0.4, removeMetadata: true }
};

📱 Progressive Web App

The app includes PWA functionality:

  • Installable: Users can install it on their devices
  • Offline Support: Basic functionality works offline
  • App-like Experience: Runs in standalone mode

🔒 Privacy & Security

  • Client-Side Processing: No files are uploaded to servers
  • No Data Collection: Files are processed locally in the browser
  • Privacy-First: User data never leaves their device
  • Secure: All processing happens in the browser sandbox

🎯 Monetization Strategy

Ad Placement Optimization

  • Multiple ad zones for maximum revenue
  • Responsive ad units for all devices
  • Strategic placement without disrupting UX
  • High-traffic areas targeted

Analytics Integration

  • User behavior tracking
  • Conversion rate monitoring
  • Ad performance metrics
  • Engagement analytics

📈 Performance Metrics

  • Lighthouse Score: Optimized for 90+ scores
  • Core Web Vitals: LCP, FID, CLS optimized
  • Loading Speed: Minimal initial bundle size
  • Compression Speed: Efficient PDF processing

🤝 Contributing

If you'd like to contribute to this project:

  1. Make your changes locally
  2. Test thoroughly across different browsers and devices
  3. Ensure all features work as expected
  4. Submit your improvements

📄 License

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

🆘 Support

For support, please check:

  1. This README for common questions
  2. Browser console for error messages
  3. Ensure PDF files are valid and under 50MB
  4. Check browser compatibility (modern browsers required)

🔮 Future Enhancements

  • Batch Download: ZIP file creation for multiple compressed PDFs
  • Advanced Compression: Image optimization within PDFs
  • Password Protection: Add/remove PDF passwords
  • Cloud Storage: Integration with Google Drive, Dropbox
  • API Integration: Backend processing for larger files
  • A/B Testing: Optimize conversion rates

Built with ❤️ for the web. Compress PDFs efficiently and privately!