{"id":20393369,"url":"https://github.com/foxitsoftware/flutter-foxitpdf","last_synced_at":"2025-09-09T19:38:34.795Z","repository":{"id":51853349,"uuid":"170649947","full_name":"foxitsoftware/flutter-foxitpdf","owner":"foxitsoftware","description":"Flutter plugin for Foxit PDF SDK to View PDF Files","archived":false,"fork":false,"pushed_at":"2024-04-24T10:24:34.000Z","size":669,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T06:43:27.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxitsoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-02-14T07:50:19.000Z","updated_at":"2023-11-09T14:01:20.000Z","dependencies_parsed_at":"2024-04-24T11:46:31.791Z","dependency_job_id":null,"html_url":"https://github.com/foxitsoftware/flutter-foxitpdf","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxitsoftware%2Fflutter-foxitpdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxitsoftware%2Fflutter-foxitpdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxitsoftware%2Fflutter-foxitpdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxitsoftware%2Fflutter-foxitpdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxitsoftware","download_url":"https://codeload.github.com/foxitsoftware/flutter-foxitpdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565091,"owners_count":21125415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T03:48:27.394Z","updated_at":"2025-07-25T21:40:33.065Z","avatar_url":"https://github.com/foxitsoftware.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Foxit PDF SDK Flutter Wrapper\r\n\r\nA new flutter for using Foxit PDF SDK to open a pdf document.\r\n\r\n- [System Requirements](#System-Requirements)\r\n- [Installation](#Installation)\r\n  - [Android](#Android)\r\n  - [iOS](#iOS)\r\n- [Usage](#Usage)\r\n- [Preview](#Preview)\r\n- [API Reference](#API-Reference)\r\n- [Issues](#Issues)\r\n\r\n## System Requirements\r\n\r\n-  Foxit PDF SDK \u003e= 6.2.1\r\n\r\n\t\tFor Android  \u003e= 6.2.1, After v7.2 only support AndroidX versions.\r\n\t\tFor IOS \u003e= 7.1\r\n    \r\n-  Flutter \u003e= 1.0.0\r\n\r\n## Installation\r\n\r\n### Android\r\n\r\n1. Follow the Flutter getting started guides to [install](https://flutter.io/docs/get-started/install), [set up an editor](https://flutter.io/docs/get-started/editor), and [create a Flutter Project.](https://flutter.io/docs/get-started/test-drive?tab=terminal#create-app) , assume you create `testflutter` as your project.\r\n\r\n2. Download [Foxit PDF SDK for Android](https://developers.foxitsoftware.com/pdf-sdk/android/) package, extract it, and copy the following files (libraries and licenses) in the \"libs\" folder of the extracted package to `testflutter\\android\\libs` directory:\r\n\r\n\t\tFoxitRDK.aar\r\n\t\tFoxitRDKUIExtensions.aar\r\n\t\tRMSSDK-4.2-release.aar\r\n\t\trms-sdk-ui.aar\r\n\t\tFoxitMobileScanningRDK.aar\r\n\t\tFoxitPDFScan-UI.aar\r\n\t\trdk_key.txt\r\n\t\trdk_sn.txt\r\n\r\n3. Add dependency to your Flutter project in `testflutter/pubspec.yaml`. \r\n```diff\r\n\t\tdependencies:\r\n\t  \t\tflutter:\r\n\t    \t\t  sdk: flutter\r\n\t\r\n+\t                flutter_foxitpdf:\r\n+  \t\t          git:\r\n+    \t\t           url: https://github.com/foxitsoftware/flutter-foxitpdf.git\r\n```\r\n\r\n4. Run `flutter packages get`\r\n\r\n5. Adjust `testflutter/android/build.gradle` file.  \r\n   **Note on modifying** build.gradle for **different Gradle/Kotlin DSL versions**  \r\n   If you are editing the Groovy DSL (build.gradle), use this:  \r\n```markdown\r\n```grooxy\r\n\t\tallprojects {\r\n\t\t    repositories {\r\n\t\t        google()\r\n\t\t        mavenCentral()\r\n+ \t\t        flatDir {\r\n+                           dirs project(':flutter_foxitpdf').file(\"$rootDir/libs\")\r\n+ \t\t       }\r\n\t\t    }\r\n\t\t}\r\n```\r\nIf you are editing the Kotlin DSL (build.gradle.kts), use this:\r\n```markdown\r\n```kotlin\r\n\t\tallprojects {\r\n\t\t    repositories {\r\n\t\t        google()\r\n\t\t        mavenCentral()\r\n+ \t\t        flatDir {\r\n+                          dirs(project(\":flutter_foxitpdf\").file(\"$rootDir/libs\"))\r\n+ \t\t       }\r\n\t\t    }\r\n\t\t}\r\n```\r\n\r\n6. Adjust `testflutter/android/app/src/main/AndroidManifest.xml` file\r\n```diff\r\n        \u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n+             xmlns:tools=\"http://schemas.android.com/tools\"\u003e\r\n\t\r\n\t    \u003capplication\r\n\t        android:name=\"io.flutter.app.FlutterApplication\"\r\n\t        android:label=\"testflutter\"\r\n\t        android:icon=\"@mipmap/ic_launcher\"\r\n+\t        tools:replace=\"android:label\"\u003e\r\n```\r\n\r\n7. Replace `lib/main.dart`, see [Usage](#usage)\r\n\r\n8. Run, You can run this prject in `Android Studio` or by using `flutter run`\r\n\r\n9. You may also clone the plugin and run `example` in the project. You need to copy the `libs` to `example/libs` directory.\r\n\r\n### iOS\r\n\r\n1. Follow the Flutter getting started guides to [install](https://flutter.io/docs/get-started/install), [set up an editor](https://flutter.io/docs/get-started/editor), and [create a Flutter Project.](https://flutter.io/docs/get-started/test-drive?tab=terminal#create-app) , assume you create `testflutter` as your project.\r\n\r\n2. Download [Foxit PDF SDK for IOS](https://developers.foxitsoftware.com/pdf-sdk/ios/) package, extract it, and copy the following files (libraries and licenses) in the \"libs\" folder of the extracted package to `testflutter\\ios\\libs` directory:\r\n\r\n        FoxitRDK.framework\r\n        uiextensionsDynamic.framework\r\n\t\tFoxitPDFScanUI.framework (v8.0)\r\n        rdk_key.txt\r\n        rdk_sn.txt\r\n\r\n3. Add dependency to your Flutter project in `testflutter/pubspec.yaml`. \r\n```diff\r\n        dependencies:\r\n              flutter:\r\n                sdk: flutter\r\n    \r\n+             flutter_foxitpdf:\r\n+               git:\r\n+                url: https://github.com/foxitsoftware/flutter-foxitpdf.git\r\n```\r\n\r\n4. Run `flutter pub get`.\r\n\r\n5. Adjust `testflutter/ios/Podfile` file\r\n```diff\r\n        # Uncomment this line to define a global platform for your project\r\n+           platform :ios, '11.0'\r\n       ......  \r\n            target 'Runner' do\r\n            ......\r\n+           #Foxit pods\r\n+           use_frameworks!\r\n+           pod 'FoxitPDF', :path=\u003e'./libs/FoxitPDF.podspec'\r\n```\r\n\r\n6. Run `flutter build ios --no-codesign`.\r\n\r\n7. Replace `lib/main.dart`, see [Usage](#usage)\r\n\r\n8. Run, You can run this prject in `Xcode` or by using `flutter run`\r\n\r\n9. You may also clone the plugin and run `example` in the project. You need to copy the `libs` to `example/ios/libs` directory.\r\n\r\n## \u003cspan id=\"usage\"\u003eUsage\u003c/span\u003e\r\n\r\nReplace `YOUR_RDK_SN` and `YOUR_RDK_KEY` with your own license (`rdk_key.txt, rdk_sn.txt`)\r\n\r\n```dart\r\n\r\n\timport 'dart:typed_data';\r\n\t\r\n\timport 'package:flutter/material.dart';\r\n\timport 'dart:async';\r\n\t\r\n\timport 'package:flutter/services.dart';\r\n\timport 'package:flutter_foxitpdf/flutter_foxitpdf.dart';\r\n\t\r\n\tvoid main() =\u003e runApp(MyApp());\r\n\t\r\n\tclass MyApp extends StatefulWidget {\r\n\t  @override\r\n\t  _MyAppState createState() =\u003e _MyAppState();\r\n\t}\r\n\t\r\n\tclass _MyAppState extends State\u003cMyApp\u003e {\r\n\t  String _platformVersion = 'Unknown';\r\n\t  int _error = -1;\r\n\t\r\n\t  String _sn = 'YOUR_RDK_SN';\r\n\t  String _key = 'YOUR_RDK_KEY';\r\n\t  String _path = 'YOUR_PDF_FILE  or  YOUR_URL';\r\n\t\r\n\t  @override\r\n\t  void initState() {\r\n\t    super.initState();\r\n\t    initPlatformState();\r\n\t\r\n\t    init(_sn, _key);\r\n      \r\n\t\topenDocument(_path, '');         //1. open doc from local path\r\n\t\t//openDocFromUrl(_path, '');     //2. open doc from url.\r\n\t  }\r\n\t\r\n\t  // Platform messages are asynchronous, so we initialize in an async method.\r\n\t  Future\u003cvoid\u003e initPlatformState() async {\r\n\t    String platformVersion;\r\n\t    // Platform messages may fail, so we use a try/catch PlatformException.\r\n\t    try {\r\n\t      platformVersion = await FlutterFoxitpdf.platformVersion;\r\n\t    } on PlatformException {\r\n\t      platformVersion = 'Failed to get platform version.';\r\n\t    }\r\n\t\r\n\t    // If the widget was removed from the tree while the asynchronous platform\r\n\t    // message was in flight, we want to discard the reply rather than calling\r\n\t    // setState to update our non-existent appearance.\r\n\t    if (!mounted) return;\r\n\t\r\n\t    setState(() {\r\n\t      _platformVersion = platformVersion;\r\n\t    });\r\n\t  }\r\n\t\r\n\t  @override\r\n\t  Widget build(BuildContext context) {\r\n\t    return MaterialApp(\r\n\t      home: Scaffold(\r\n\t        appBar: AppBar(\r\n\t          title: const Text('Plugin example app'),\r\n\t        ),\r\n\t        body: Center(\r\n\t          child: Text('Running on: $_platformVersion\\n'),\r\n\t        ),\r\n\t      ),\r\n\t    );\r\n\t  }\r\n\t\r\n\t  Future\u003cvoid\u003e init(String sn, String key) async {\r\n\t    int error;\r\n\t    try {\r\n\t      error = await FlutterFoxitpdf.initialize(sn, key);\r\n\t    } on PlatformException {\r\n\t      error = -1;\r\n\t    }\r\n\t    setState(() {\r\n\t      _error = error;\r\n\t    });\r\n\t  }\r\n\t\r\n\t  Future\u003cvoid\u003e openDocument(String path, String password) async {\r\n\t    await FlutterFoxitpdf.openDocument(path, password);\r\n\t  }\r\n\r\n\t  Future\u003cvoid\u003e openDocFromUrl(String url, String password) async {\r\n\t\t  await FlutterFoxitpdf.openDocFromUrl(url, password);\r\n\t  }\r\n\t}\r\n```\r\n\r\n## Preview\r\n\r\n![foxit_plugin](./readmeimg/foxit_plugin.png)  \r\n\r\n\r\n## API Reference\r\n**Initialize Foxit PDF SDK**\r\n\r\n\tFlutterFoxitpdf.initialize(String, String);\r\n\r\n**Open a pdf document from local path**\r\n\r\n\tFlutterFoxitpdf.openDocument(String, String)\r\n\r\n**Open a pdf document from url**\r\n\r\n\tFlutterFoxitpdf.openDocFromUrl(String, String)\r\n\r\n## Issues\r\n\r\n### Android\r\n\r\n#### 1: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:flutter_foxitpdf]\r\n\r\nSuggestion：Increase your project's `android/app/build.gradle` minSdk version to at least 19.\r\n\r\n#### 2:Manifest merger failed : Attribute application@label.\r\n\r\nSuggestion: Add `tools:replace=\"android:label\"` to \u003capplication\u003e element at AndroidManifest.xml to override.\r\n\r\n#### 3:com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:The number of method references in a .dex file cannot exceed 64K.\r\n\r\nSuggestion: Add `multiDexEnabled true` to `android#defaultConfig`at `android/app/build.gradle`.\r\n\t\r\n#### 4:java.lang.OutOfMemoryError.\r\n\r\nSuggestion: Add `org.gradle.jvmargs=-Xmx2048M` to `android/gradle.properties`\r\n\t\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxitsoftware%2Fflutter-foxitpdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxitsoftware%2Fflutter-foxitpdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxitsoftware%2Fflutter-foxitpdf/lists"}