Copy and paste annotations on Android
Nutrient Android SDK has support for copying and pasting annotations. This works between pages of a document and even between multiple documents. It is also integrated into the system clipboard, which allows images and text to be copied and pasted in both directions. Copying images is not supported by all applications. Check out the CopyToClipboardActivity
example in the Catalog app to see how to add support for this to your application.
Configuration
We provide granular control over which parts of our copy and paste integration is enabled.
PdfConfiguration
The PdfConfiguration
— and by extension, PdfActivityConfiguration
— allows you to completely disable copy and paste support using [copyPasteEnabled(false)
][]. If you just need to disable part of our copy and paste integration, we provide more fine-grained control using CopyPasteFeatures
and setEnabledCopyPasteFeatures()
.
ApplicationPolicy
Providing a custom ApplicationPolicy
allows you to configure global copy and paste settings. The relevant PolicyEvent
s are:
-
ANNOTATION_COPY_PASTE_SYSTEM_INTEGRATION
— To enable or disable the integration with the system clipboard. -
TEXT_COPY_PASTE
— To enable or disable the option to copy text out of documents.
Keyboard Shortcuts
In addition to triggering copy and paste from the UI, we also support common keyboard shortcuts like Ctrl + C for copying, Ctrl + X for cutting, and Ctrl + V for pasting annotations.