Giter Club home page Giter Club logo

pdf_merger's Introduction

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

pdf_merger's People

Contributors

abhay-ril avatar abhay0648 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.