pdf_utils

A comprehensive, standalone Flutter plugin for professional PDF manipulation and generation. It has 28+ tools! Just using a single small library!

pub package Dart License: MIT

Pub.dev | Repository | Issues | Documentation


    1. Powerful PDF Compression!
    1. Advanced PDF Viewer (BipPdfViewer)
    1. Lightweight PDF Thumbnails
    1. Page Manipulation
    • i. Reorder,
    • ii. Delete,
    • iii. Rotate,
    • iv. Insert
    1. Combine/Split PDFs
    • i. PDF Merging,
    • ii. PDF Splitting
    1. PDF Resizing
    • i. Smart PDF Resizing(Actually!),
    • ii. Smart PDF Scaling
    1. Extraction
    • i. Extract Text From PDF!
    • ii. Extract Metadata
    • iii. Extract Images From PDF!
    1. Security Status
    • i. Check Security Status (locked/unlocked)
    • ii. Check Permissions(If editable/printable/copyable/annotatable etc.)
    1. Encryption & Decryption
    • i. Lock PDF
    • ii. Unlock PDF
    1. Overlay
    • i. Auto Page Numbering
    • ii. Customizable headers and footers
    • iii. Add Text Overlay
    • iv. Add Image Overlay
    • v. Add Text and Image at once!
    • vi. Add Text and Image as watermark!
    1. Native System Printing
    1. High-Speed Image to PDF Conversion
    1. Auto Blank Page Removal!
    1. Professional Invoice Generation!
  • That means 28+ tools! And some small features!
  • More Features Coming Soon!

Showcase

🎨 Creation & Design

Invoice Generation Image to PDF Advanced Watermark
Invoice Demo App Home Watermarking
Professional Invoices Native Image-to-PDF Advanced Branding

📄 Page Manipulation & Assembly

Reorder & Delete Insert Page/Image Dynamic Numbering
Reorder/Delete Insert Page Page Numbering
Page Reorganization Flexible Insertion Headers & Footers
Merge PDFs Split PDFs Page Resizing
Merge PDF Split PDF Resize Page
Native High-Speed Merge Selective Splitting A4/Target Rescaling

🛠️ Utilities & Analysis

Advanced Viewer Lightweight Thumbnails Security Status
PDF Viewer Thumbnails Security Status
Premium BipPdfViewer Fast Page Previews Permission Analysis
Native Printing PDF Compression Image Extraction
Native Print Compression Extraction
System Print Dialog File Size Optimization Page to Image
Long Image Text Extraction
Long Image Text Extraction
Long Vertical Layouts Robust Text Retrieval

Installation

Add pdf_utils to your pubspec.yaml:

dependencies:
  pdf_utils: ^3.3.0

Quick Start

1. Generating an Invoice

final invoice = Invoice(...);
File pdfFile = await PdfInvoiceGenerator.generate(invoice);

2. Merging PDFs (Native)

File? merged = await PdfUtils.mergePdfs(
  ['path1.pdf', 'path2.pdf'],
);

3. Advanced Viewer

Navigator.push(
  context, 
  MaterialPageRoute(
    builder: (context) => BipPdfViewer(
      filePath: 'my_doc.pdf',
      title: 'Monthly Report',
    )
  )
);

4. Text & Metadata Extraction

final doc = await PDFDoc.fromPath('doc.pdf');
String text = await doc.text;
print('Total pages: ${doc.length}');
print('Author: ${doc.info.author}');

5. Locking a PDF

File? secured = await PdfUtils.encryptPdf(
  filePath: 'doc.pdf',
  userPassword: 'my_password',
  allowPrinting: true,
);

Documentation

Full detailed guides are available in the doc/ folder:

Example App

Check the example folder for a complete demonstration of the plugin's features on real devices.

License

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