Skip to content
ComPDF
Guides

Overview & Architecture

ComPDFKit_Tools is the UI component module provided by ComPDF SDK for the Android platform. Built on top of the core library compdfkit and the UI base library compdfkit-ui, it wraps a complete document interaction interface and business logic that developers can integrate directly or customize further.

Module Positioning

compdfkit          ← Core PDF engine (rendering, parsing, editing)
compdfkit-ui       ← Base UI controls (CPDFReaderView, etc.)
ComPDFKit_Tools    ← Business UI components (this module)
PDFViewer          ← Sample application
  • compdfkit: Provides low-level PDF parsing, rendering, annotations, forms, signatures, and more.
  • compdfkit-ui: Provides base view controls such as CPDFReaderView and CPDFViewCtrl.
  • ComPDFKit_Tools: On top of the above two, provides a ready-to-use complete document interface including toolbars, property panels, dialogs, and the configuration system.

Package Structure

The module source code is located under the com.compdfkit.tools package, organized by function:

PackageFunctionalityCore Classes
common/Common frameworkCPDFDocumentActivity, CPDFDocumentFragment, CPDFConfiguration, ContextMenu, Toolbar, Properties, utilities
annotation/AnnotationsCAnnotationToolbar, annotation list, property editing Fragments for each annotation type
viewer/ViewerBookmarks, outlines, reading settings, search & replace, thumbnails
forms/FormsCFormToolbar, property editing Fragments for each form type
contenteditor/Content editingCEditToolbar, text property editing, image property editing
docseditor/Page editingPage editing panel, insert/delete/rotate/drag-to-reorder
security/Security featuresDocument encryption dialog, watermark editor
signature/Digital signaturesSignature toolbar, certificate import/creation, signature verification and info
compress/PDF compressionCompression dialog

Common Package Details

common/ is the core framework package of the entire module, containing the following sub-modules:

Entry Classes

  • CPDFDocumentActivity: A ready-to-use full-screen PDF document Activity that supports passing file paths/Uris, passwords, and configurations via Intent.
  • CPDFDocumentFragment: A PDF document Fragment that can be embedded in any Activity for flexible interaction with the host page.

Configuration System (common/pdf/config/)

A JSON-driven configuration system that controls all UI behavior:

  • CPDFConfiguration: Top-level configuration class that aggregates all sub-configurations.
  • ModeConfig: Mode configuration (initial mode, available modes list, UI visibility).
  • ToolbarConfig: Toolbar configuration (menu items, custom buttons).
  • AnnotationsConfig: Annotation configuration (available types, tools, default properties).
  • ContentEditorConfig: Content editor configuration.
  • FormsConfig: Forms configuration.
  • ReaderViewConfig: Reader view configuration (display mode, theme, spacing, zoom, etc.).
  • GlobalConfig: Global configuration (theme mode, save behavior, BOTA, search, watermark, etc.).
  • ContextMenuConfig: Context menu configuration.

Context Menus (common/contextmenu/)

Provides long-press/selection menus for different objects, including 20+ menu implementations: Markup annotations, Shape annotations, FreeText, Ink, Stamp, Sound, Link, EditText, EditImage, EditPath, various forms, long-press blank area, text selection, search & replace, screenshot, and more.

Property Panels (common/views/pdfproperties/)

A unified property editing panel architecture, displayed via CStyleDialogFragment, supporting color, font, opacity, line width, and other property editing.

Event System (common/utils/customevent/)

  • CPDFCustomEventCallbackHelper: Custom event callback manager.
  • CPDFCustomEventType: Event type enumeration (toolbar click, context menu click, etc.).
  • CPDFCustomEventField: Event field constants.

Utilities (common/utils/)

File operations, permission management, image processing, printing, thread pool, animations, and other general utilities.

Quick Reference

If you want to…See
Quickly integrate and display a PDFIntegrationQuick Start
Learn about the configuration systemConfiguration Overview
Customize toolbar buttonsTop ToolbarCustom Toolbar Items
Customize annotation/form behaviorAnnotations / Forms
Listen for user actionsEvent Callbacks
Customize the app themeTheming & Styles