Skip to content
ComPDF
Guides

Integration

The SDK supports multiple integration methods. Choose the one that best suits your project needs.

Version & Compatibility

  • The compdfkit-tools version must be consistent with compdfkit and compdfkit-ui.
  • Please select appropriate minSdk / compileSdk / targetSdk and AGP versions according to the SDK release notes.
  • If R8/ProGuard obfuscation is enabled, refer to the obfuscation configuration included with the SDK.

Gradle Integration

  1. Open the settings.gradle file in your project root directory and add the mavenCentral repository:
diff
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
+       mavenCentral()
    }
}
  1. Open the build.gradle file in your application module directory:
Gradle configuration

Edit and add the ComPDFKit_Tools module dependency:

groovy
def compdfVersion = "2.6.0" // Must match compdfkit / compdfkit-ui version

dependencies {
  implementation "com.compdf:compdfkit-tools:${compdfVersion}"
  // Or depend on core and UI modules separately (versions must match):
  // implementation "com.compdf:compdfkit:${compdfVersion}"
  // implementation "com.compdf:compdfkit-ui:${compdfVersion}"
}

Manual Integration

  1. Copy ComPDFKit-Tools.aar to the libs directory of the app module.
AAR placed in app/libs directory
  1. Add the following code to the build.gradle file under the app directory:
groovy
dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}

Make sure to also depend on ComPDFKit.aar and ComPDFKit-UI.aar via manual integration to ensure proper operation.

Source Code Integration

You can obtain the ComPDFKit_Tools module source code from the SDK installation package or the GitHub sample project.

  1. Download or extract the SDK source code.
  2. In Android Studio, import the module via File → New → Import Module.
Import Module
  1. Add the following to app/build.gradle:
groovy
dependencies {
    implementation project(path: ':ComPDFKit_Tools')
}

Source code integration allows you to directly modify the Tools module code for deeper customization.