패키지, 저장소 및 앱 카테고리 검색

pdf_thumbnail 표지
패키지 상세v0.1.6+1

pdf_thumbnail

PDF 파일용 썸네일 뷰어입니다. Android 및 iOS를 지원합니다. 위젯을 추가하고 파일 경로를 제공하기만 하면 됩니다.

AndroidiOSWebmacOSWindows
30일 다운로드
5
좋아요
51
Pub 점수
150

패키지 설치

flutter pub add pdf_thumbnail

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

안드로이드, iOS, 웹, macOS 및 Windows에서 PDF 썸네일을 표시하기 위한 플러터 패키지입니다. 위젯을 추가하고 파일 경로를 제공함으로써 개발자가 앱에 썸네일 뷰어를 쉽게 통합할 수 있습니다. 이 패키지는 복잡한 설정 없이 PDF 페이지 미리보기를 원활하게 렌더링하도록 설계된 가벼운 패키지입니다. 문서 관리 앱이나 PDF 콘텐츠에 빠르게 시각적으로 접근해야 하는 모든 애플리케이션에 적합합니다.

사용 사례

  • 모바일 앱에서 문서 미리보기
  • PDF 갤러리 인터페이스
  • 빠른 파일 탐색
  • 전자학습 플랫폼
  • 디지털 도서관 애플리케이션

주요 기능

  • 크로스 플랫폼 지원
  • 간단한 위젯 통합
  • 파일 경로 입력
  • 경량 렌더링
  • 반응형 썸네일 레이아웃

적합한 대상

  • 문서 뷰어를 구축하는 개발자
  • PDF 탐색이 필요한 앱
  • 교육용 또는 기업용 소프트웨어
  • UI 중심의 PDF 애플리케이션

고려 사항

  • 유효한 PDF 파일 경로가 필요합니다
  • 미리보기만 표시 가능
  • 인터랙티브 PDF 기능 없음
  • 큰 PDF 파일에 최적화되지 않음
  • 기반 플랫폼 렌더링에 따라 다릅니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Pdf Thumbnail

style: very good analysis Powered by Mason License: MIT

Thumbnail viewer for pdfs

Installation 💻

❗ In order to start using Pdf Thumbnail you must have the Flutter SDK installed on your machine.

Add pdf_thumbnail to your pubspec.yaml:

dependencies:
  pdf_thumbnail:

Install it:

flutter packages get

Example ✍️

 return Stack(
              children: [
                SizedBox(
                  height: MediaQuery.of(context).size.height,
                  width: MediaQuery.of(context).size.width,
                  child: PdfViewer(
                    filePath: snapshot.data!.path,
                  ),
                ),
                if (showThumbnail)
                  Positioned(
                    bottom: 0,
                    width: MediaQuery.of(context).size.width,
                    // Here's the thumbnail widget.
                    child: PdfThumbnail.fromFile(snapshot.data!.path),
                  ),
              ],
            );

There is a detailed example app in the repo, but I've deleted iOS and Android folders. Simple go to example folder, and run flutter create . inside the folder to add missing native files for the example app.

Demo

gif

Caching ⏲

I left caching part unopinionated to keep the package simple. Just create your own class from ImageThumbnailCacher and implement the read/write methods. Holding images as Uint8List, so Map<int, Uint8List> is what's need to be written to and read from the cache. It maps page numbers to the images.

class ThumbnailCacher implements ImageThumbnailCacher {
  @override
  Future<PageToImage?> read(String id) async {
    return api.localStorage.readThumbnails(id);
  }

  @override
  Future<bool> write({required String id, required PageToImage map}) {
    return api.localStorage.writeThumbnails(id: id, map: map);
  }
}

I'm using Hive to cache.

Roadmap 🗺️

  • [X] Customization for colors, decoration etc.
  • [X] onTap callback and page number.
  • [X] Caching.
  • [ ] Different layouts and scroll axises.
  • [ ] Lazy loading.

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.