mini_pdf_epub_viewer 0.1.2 copy "mini_pdf_epub_viewer: ^0.1.2" to clipboard
mini_pdf_epub_viewer: ^0.1.2 copied to clipboard

A Flutter package for viewing PDF and EPUB documents from various sources (assets, files, network).

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:mini_pdf_epub_viewer/mini_pdf_epub_viewer.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: DocumentViewer(
        /// Add this line to change the theme
        // themeMode: ThemeMode.dark,
        thumbnailWidth: 150,
        source: DocumentSource.asset('assets/pdf/sample.pdf'),
        type: DocumentType.pdf,
      ),

      /// For file
      // home: DocumentViewer(
      //   source: DocumentSource.file('/path/to/file.pdf'),
      //   type: DocumentType.pdf,
      // )
      /// For network
      /// home: DocumentViewer(
      ///  source: DocumentSource.network(
      ///   'https://pdfobject.com/pdf/sample.pdf',
      ///  headers: {}, // Optional
      /// ),
    );
  }
}
6
likes
140
points
8
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for viewing PDF and EPUB documents from various sources (assets, files, network).

Homepage
Repository (GitHub)
View/report issues

Topics

#pdf #mini #epub #reader

Documentation

API reference

Funding

Consider supporting this project:

buymeacoffee.com

License

MIT (license)

Dependencies

flutter, http, path_provider, pdfx

More

Packages that depend on mini_pdf_epub_viewer