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
CPDFReaderViewandCPDFViewCtrl. - 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:
| Package | Functionality | Core Classes |
|---|---|---|
common/ | Common framework | CPDFDocumentActivity, CPDFDocumentFragment, CPDFConfiguration, ContextMenu, Toolbar, Properties, utilities |
annotation/ | Annotations | CAnnotationToolbar, annotation list, property editing Fragments for each annotation type |
viewer/ | Viewer | Bookmarks, outlines, reading settings, search & replace, thumbnails |
forms/ | Forms | CFormToolbar, property editing Fragments for each form type |
contenteditor/ | Content editing | CEditToolbar, text property editing, image property editing |
docseditor/ | Page editing | Page editing panel, insert/delete/rotate/drag-to-reorder |
security/ | Security features | Document encryption dialog, watermark editor |
signature/ | Digital signatures | Signature toolbar, certificate import/creation, signature verification and info |
compress/ | PDF compression | Compression 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 PDF | Integration → Quick Start |
| Learn about the configuration system | Configuration Overview |
| Customize toolbar buttons | Top Toolbar → Custom Toolbar Items |
| Customize annotation/form behavior | Annotations / Forms |
| Listen for user actions | Event Callbacks |
| Customize the app theme | Theming & Styles |