搜尋套件、儲存庫與 APP 分類

pdf_merger 封面
套件詳情v0.0.6

pdf_merger

一個用於合併PDF檔案清單的新Flutter外掛程式。它同時支援Android和iOS。在呼叫此套件之前,請確保已允許權限和檔案選擇器,詳見範例。

AndroidiOS
近 30 天下載
325
喜歡數
27
Pub 分數
130

安裝套件

flutter pub add pdf_merger

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

pdf_merger 是一個 Flutter 插件,可在 Android 與 iOS 平台上將多個 PDF 檔案合併為單一文件。它提供簡單的 API,可程式化地合併 PDF 檔案,非常適合需要文件整合的應用程式。如範例所示,使用者必須授與檔案權限並整合檔案選擇器後才能使用此套件。該套件輕量且專為與現有 Flutter 項目無縫整合而設計。

適用情境

  • 從用戶選擇合併多個PDF
  • 將報告或表單合併為一個檔案
  • 支援文件處理工作流程
  • 建立合併的PDF以分享
  • 在應用程式中自動聚合PDF
  • 啟用離線PDF管理

主要特色

  • 跨平台支援(Android 與 iOS)
  • 簡單合併 API
  • 與檔案選擇器整合相容
  • 輕便高效
  • 支援 PDF 檔案清單
  • 輕鬆設定,文件清楚

適合對象

  • 文件管理應用
  • 教育工具
  • 商業報告應用
  • 表單和提交系統
  • PDF 處理工具
  • 需要PDF合併的行動應用程式

使用建議

  • 需要檔案權限處理
  • 需要外部文件選擇器整合
  • 僅限合併,無法編輯PDF
  • 無內建預覽功能
  • 依賴於範例程式碼中的正確設定
  • 不適用於大規模PDF操作

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

pdf_merger

A new Flutter plugin for merge List of PDF files. It supports both android and IOS. Before call this package make sure you allow permission and file picker see example. Also check file_picker and permission handle to implement before calling the plugin.

PDF merger method

Merge Multiple PDF


  //paths is a list of paths, example List<String> allSelectedFilePath. 
  //outputDirPath is output path with filename, exmaple /user/android/download/ABC.pdf
  
 MergeMultiplePDFResponse response  = await PdfMerger.mergeMultiplePDF(paths: filesPath, outputDirPath: outputDirPath);
 
  if(response.status == "success") {
  //response.response for output path  in String
  //response.message for success message  in String
  }
  
  

Create PDF From Multiple Image


  //paths is a list of paths, example List<String> allSelectedFilePath. 
  //outputDirPath is output path with filename, exmaple /user/android/download/ABC.pdf
  //Optional params maxWidth : defalut set to 360, maxHeight : defalut set to 360, needImageCompressor : default set to true.
  
 CreatePDFFromMultipleImageResponse response  = PdfMerger.createPDFFromMultipleImage(paths: filesPath, outputDirPath: outputDirPath);
 
  if(response.status == "success") {
   //response.response for output path in String
  //response.message for success message  in String
  }
  

Create Image From PDF


  //paths selected file path (String). Example user/android.downlaod/MYPDF.pdf
  //outputDirPath is output path with filename, exmaple /user/android/download/ABC.pdf
 //Optional params maxWidth : defalut set to 360, maxHeight : defalut set to 360, createOneImage : default set to true.
 
 CreateImageFromPDFResponse response  = await PdfMerger.createImageFromPDF(path: singleFile, outputDirPath: outputDirPath);
 
  if(response.status == "success") {
   //response.response for output path in List<String>
  //response.message for success message  in String
  }
  

Get File Size


  //paths selected file path (String). Example user/android.downlaod/MYPDF.pdf
  
 SizeFormPathResponse response  = await PdfMerger.sizeFormPath(path: singleFile);
 
  if(response.status == "success") {
   //response.response for size of file
  //response.message for success message  in String
  }
  

Build Info


 BuildInfoResponse response  = await PdfMerger.buildInfo();
 
 Get.snackbar("Info", "App Name : " + response.appName + "\n" +
            "Build Number : " + response.buildDate + "\n" +
            "Build Number with Time : " + response.buildDateWithTime + "\n" +
            "Package Name : " + response.packageName + "\n" +
            "Version Number : " + response.versionNumber + "\n" +
            "Build Number : " + response.buildNumber.toString() );
  

Android & IOS

ios_1

ios_2

android

Usage

See Example. Use with file picker and add permission handler before calling pdf_merger. Make sure to call permission handler for write permission before call pdf_merger.

file_picker

https://pub.dev/packages/file_picker

permission_handler

https://pub.dev/packages/permission_handler

Support

Android & IOS

For Android

Add these lines in your progaurd

//required to prevent errors from the spongycastle libraries
-keep class org.spongycastle.** { *; }
-dontwarn org.spongycastle.**

For IOS

All set

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。