{"_id":"@capawesome/capacitor-pdf-annotator","_rev":"2-67cd80adb8c2db9883e867a9887c9bf6","name":"@capawesome/capacitor-pdf-annotator","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@capawesome/capacitor-pdf-annotator","version":"0.0.1","keywords":["capacitor","plugin","native","pdf","annotation","annotate","markup","document","capacitor-plugin","pdf annotator","pdf annotation","pdf markup","pdf editor","draw on pdf","highlight pdf"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-pdf-annotator@0.0.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/pdf-annotator/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"c4eb01c719d6946590d852ffbe32bed2c3103a47","tarball":"https://registry.npmjs.org/@capawesome/capacitor-pdf-annotator/-/capacitor-pdf-annotator-0.0.1.tgz","fileCount":46,"integrity":"sha512-S5ZwgGz4UIaTXQCgeG1teHUChsbHcG2iC6XRGDnn+9Ac26aSM0wqj45lAl/W7XDn4KJuMiHeoluaVOuzEWcucw==","signatures":[{"sig":"MEYCIQCy6i2Cvbs8GHZ8kG5hNvsZ/qtm7OcmW4KH3VXpmXLs/AIhALsEvg24meGGy7/igH/J1Z91/WY53SwLFU0s+ysYefwT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79245},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"0af28c38a89b8c7d99f350f09b34840f4391803d","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api PdfAnnotatorPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"robingenz","email":"mail@robingenz.dev"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.13.0","description":"Capacitor plugin to annotate PDF documents in a fullscreen native viewer on Android and iOS.","directories":{},"_nodeVersion":"24.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.4.2","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.9.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-pdf-annotator_0.0.1_1788525091114_0.069820060106764","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"_id":"@capawesome/capacitor-pdf-annotator@0.1.0","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"57970a76c09f68be91a247b0e7f6271f055937f3","tarball":"https://registry.npmjs.org/@capawesome/capacitor-pdf-annotator/-/capacitor-pdf-annotator-0.1.0.tgz","fileCount":46,"integrity":"sha512-c+mzkiXkYZYwKSUROV9oJi9XG5TxQWnaQk9cppRKgfGnxvjj5HP9v4VMqBh6ROCnfSZRgpPeuS9B+vj+yFt6Aw==","signatures":[{"sig":"MEUCID5dwm9uqGrVNcgKb2I/ehSXlaqrUPpreLzo+7itpuWgAiEA4CPnOgzlqHrixXvFeLx7pEjQswaPYo9AP/q8+C72/kw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHnpr0UUE9+2KKdMN49GiCNLyHM4UpijJvAOw14FEblaAiB29OGy4eZdfyiYEGCIiH4bp8v87ArOoEzckyhZz+28vA=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-pdf-annotator@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":79245},"main":"dist/plugin.cjs.js","name":"@capawesome/capacitor-pdf-annotator","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"67a29d24e4ee9cf112a2bcb234a59b2e28e8d3f1","license":"MIT","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api PdfAnnotatorPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"version":"0.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:686a589b-f570-47b0-a789-78f699dbc749"}},"homepage":"https://capawesome.io/docs/sdks/capacitor/pdf-annotator/","keywords":["capacitor","plugin","native","pdf","annotation","annotate","markup","document","capacitor-plugin","pdf annotator","pdf annotation","pdf markup","pdf editor","draw on pdf","highlight pdf"],"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.19.0","description":"Capacitor plugin to annotate PDF documents in a fullscreen native viewer on Android and iOS.","directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_nodeVersion":"24.20.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.4.2","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.9.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-pdf-annotator_0.1.0_1788539393552_0.8865616033072712"}}},"time":{"created":"2026-09-04T12:31:30.952Z","modified":"2026-09-04T16:29:54.012Z","0.0.1":"2026-09-04T12:31:31.262Z","0.1.0":"2026-09-04T16:29:53.628Z"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","homepage":"https://capawesome.io/docs/sdks/capacitor/pdf-annotator/","keywords":["capacitor","plugin","native","pdf","annotation","annotate","markup","document","capacitor-plugin","pdf annotator","pdf annotation","pdf markup","pdf editor","draw on pdf","highlight pdf"],"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"description":"Capacitor plugin to annotate PDF documents in a fullscreen native viewer on Android and iOS.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor PDF Annotator Plugin\n\nCapacitor plugin to annotate PDF documents in a fullscreen native viewer.\n\n<div class=\"capawesome-z29o10a\">\n  <a href=\"https://cloud.capawesome.io/\" target=\"_blank\">\n    <img alt=\"Deliver Live Updates to your Capacitor app with Capawesome Cloud\" src=\"https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1\" />\n  </a>\n</div>\n\n## Features\n\n- ✍️ **Annotate**: Draw, highlight and erase on top of any PDF document with the native markup tools.\n- ↩️ **Undo & Redo**: Undo and redo changes while annotating.\n- 🖊️ **Apple Pencil**: Full Apple Pencil support on iPad.\n- 💾 **Non-destructive**: The original file is never modified. Annotations are saved to a copy.\n- ✅ **Availability Check**: Check whether annotation is supported on the current device.\n- 🔒 **App Store safe**: Uses only official platform APIs.\n- 🤝 **Compatibility**: Works alongside the [PDF Viewer](https://capawesome.io/docs/sdks/capacitor/pdf-viewer/), [File Opener](https://capawesome.io/docs/sdks/capacitor/file-opener/) and [File Picker](https://capawesome.io/docs/sdks/capacitor/file-picker/) plugins.\n- 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.\n- 🔁 **Up-to-date**: Always supports the latest Capacitor version.\n\nMissing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!\n\n## Use Cases\n\nThe PDF Annotator plugin is typically used whenever users need to mark up a PDF document, for example:\n\n- **Sheet music**: Let musicians write fingerings, breath marks or cues on their scores and highlight passages.\n- **Document review**: Let users highlight sections and add handwritten remarks to contracts, reports or proofs.\n- **Field work**: Let technicians draw on plans and inspection reports directly on site.\n- **Education**: Let students and teachers annotate worksheets, handouts and exercises.\n\n## Compatibility\n\n| Plugin Version | Capacitor Version | Status         |\n| -------------- | ----------------- | -------------- |\n| 0.x.x          | >=8.x.x           | Active support |\n\n## Installation\n\nYou can use our **AI-Assisted Setup** to install the plugin.\nAdd the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:\n\n```bash\nnpx skills add capawesome-team/skills --skill capacitor-plugins\n```\n\nThen use the following prompt:\n\n```\n Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-pdf-annotator` plugin in my project.\n```\n\nIf you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:\n\n```bash\nnpm install @capawesome/capacitor-pdf-annotator\nnpx cap sync\n```\n\n### Android\n\nOn Android, this plugin uses the [Jetpack PDF](https://developer.android.com/jetpack/androidx/releases/pdf) library, which provides a pen, a highlighter, an eraser and undo/redo. The annotation features of this library are currently in beta and marked as experimental by Google.\n\n#### SDK Extension Level\n\nThe Jetpack PDF library requires your app to be compiled against Android SDK 36 with SDK extension level 19 or higher. Add the `compileSdkExtension` property to the `android` block of your app's `android/app/build.gradle` file:\n\n```groovy\nandroid {\n    compileSdk = rootProject.ext.compileSdkVersion\n    compileSdkExtension = 19\n    // ...\n}\n```\n\nThis requires the `Android SDK Platform 36-ext19` package. If it is not installed automatically during the build, install it via the SDK Manager of Android Studio (enable **Show Package Details** in the **SDK Platforms** tab) or by running the following command:\n\n```bash\nsdkmanager \"platforms;android-36-ext19\"\n```\n\nIf your app is already compiled against Android SDK 37 or higher (requires Android Gradle Plugin 9.1 or higher), no extension level needs to be set.\n\n#### Device Support\n\nAnnotating PDF documents requires Android 11 (API level 30) or higher and a PDF system module that supports annotations (SDK extension level 18 or higher). This module ships with Android 16 QPR2 and is delivered to older devices via Google Play system updates. Always check the availability with the `isAvailable()` method before calling `open(...)`.\n\n#### Variables\n\nIf needed, you can define the following project variables in your app’s `variables.gradle` file to change the default version of the dependencies:\n\n- `$androidxPdfVersion` version of `androidx.pdf:pdf-ink` and `androidx.pdf:pdf-viewer-fragment` (default: `1.0.0-beta01`)\n- `$androidxMaterialVersion` version of `com.google.android.material:material` (default: `1.13.0`)\n\n### iOS\n\nOn iOS, this plugin uses the [Quick Look](https://developer.apple.com/documentation/quicklook) framework, which provides the system markup tools (pen, highlighter, pencil, eraser, shapes, text, signature and undo/redo) including Apple Pencil support. No additional configuration is required.\n\nBe aware that the markup tools are not available on all simulator versions. Test the plugin on a real device.\n\n### Web\n\nThis plugin is not available on the web.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\nThe following examples show how to check the availability, open a PDF document for annotation and keep the annotated file.\n\nThe plugin only supports local files. Remote URLs must be downloaded first, for example with the `downloadFile(...)` method of the [Filesystem](https://capacitorjs.com/docs/apis/filesystem) plugin.\n\n### Check the availability\n\nCheck whether PDF annotation is supported on the current device before showing an annotation button to the user:\n\n```typescript\nimport { PdfAnnotator } from '@capawesome/capacitor-pdf-annotator';\n\nconst isAvailable = async () => {\n  const { available } = await PdfAnnotator.isAvailable();\n  return available;\n};\n```\n\n### Annotate a PDF document\n\nOpen a local PDF file in a fullscreen native viewer that lets the user annotate it. The promise resolves with the path of the annotated copy when the user saves the annotations and closes the viewer. If the user closes the viewer without saving, the promise is rejected with the `CANCELED` error code. Only available on Android and iOS:\n\n```typescript\nimport { ErrorCode, PdfAnnotator } from '@capawesome/capacitor-pdf-annotator';\n\nconst open = async () => {\n  try {\n    const { path } = await PdfAnnotator.open({\n      path: 'file:///path/to/document.pdf',\n    });\n    console.log('Annotated file: ', path);\n  } catch (error) {\n    if (error.code === ErrorCode.Canceled) {\n      console.log('The user closed the viewer without saving.');\n    }\n  }\n};\n```\n\n### Keep the annotated file\n\nThe annotated file is stored in the cache directory and deleted on the next app launch. Move it to a permanent location with the [Filesystem](https://capacitorjs.com/docs/apis/filesystem) plugin if you want to keep it:\n\n```typescript\nimport { Directory, Filesystem } from '@capacitor/filesystem';\nimport { PdfAnnotator } from '@capawesome/capacitor-pdf-annotator';\n\nconst annotateAndKeep = async () => {\n  const { path } = await PdfAnnotator.open({\n    path: 'file:///path/to/document.pdf',\n  });\n  await Filesystem.copy({\n    from: path,\n    to: 'annotated.pdf',\n    toDirectory: Directory.Documents,\n  });\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`isAvailable()`](#isavailable)\n* [`open(...)`](#open)\n* [Interfaces](#interfaces)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### isAvailable()\n\n```typescript\nisAvailable() => Promise<IsAvailableResult>\n```\n\nCheck whether PDF annotation is available on this device.\n\nOn **Android**, this resolves to `true` if the device runs Android 11 (API level 30)\nor higher and its PDF system module supports annotations (SDK extension level 18 or higher).\nOn **iOS**, this always resolves to `true`.\nOn **Web**, this always resolves to `false`.\n\n**Returns:** <code>Promise&lt;<a href=\"#isavailableresult\">IsAvailableResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### open(...)\n\n```typescript\nopen(options: OpenOptions) => Promise<OpenResult>\n```\n\nOpen a PDF file in a fullscreen native viewer that lets the user annotate it.\n\nThe promise resolves with the path of the annotated copy when the user\nsaves the annotations and closes the viewer. If the user closes the viewer\nwithout saving, the promise is rejected with the `CANCELED` error code.\nThe original file is never modified.\n\nOnly available on Android and iOS.\n\n| Param         | Type                                                |\n| ------------- | --------------------------------------------------- |\n| **`options`** | <code><a href=\"#openoptions\">OpenOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#openresult\">OpenResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### IsAvailableResult\n\n| Prop            | Type                 | Description                                                | Since |\n| --------------- | -------------------- | ---------------------------------------------------------- | ----- |\n| **`available`** | <code>boolean</code> | Whether or not PDF annotation is available on this device. | 0.1.0 |\n\n\n#### OpenResult\n\n| Prop       | Type                | Description                                                                                                                                                                           | Since |\n| ---------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`path`** | <code>string</code> | The path of the annotated copy of the PDF file. The file is stored in the cache directory and deleted on the next app launch. Move it to a permanent location if you want to keep it. | 0.1.0 |\n\n\n#### OpenOptions\n\n| Prop       | Type                | Description                                                                                                                                                                          | Since |\n| ---------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |\n| **`path`** | <code>string</code> | The path of the local PDF file to annotate. Remote URLs are not supported. Download the file first, for example to the cache directory, and pass the local file path to this method. | 0.1.0 |\n\n</docgen-api>\n\n## FAQ\n\n### How is this plugin different from other similar plugins?\n\nIt lets users draw, highlight and erase on top of a PDF document with the native markup tools of each platform, backed by Quick Look on iOS and the Jetpack PDF library on Android for a genuinely native annotation experience with undo/redo and Apple Pencil support. The original file is never touched: the annotated document is handed back as a separate file through a fully typed API that uses only official platform APIs. Actively maintained against the latest Capacitor version, it also pairs naturally with the PDF Viewer, PDF Generator and File Picker plugins.\n\n### How is this plugin different from the PDF Viewer plugin?\n\nThe [PDF Viewer](https://capawesome.io/docs/sdks/capacitor/pdf-viewer/) plugin is a lightweight, read-only viewer with paging, zoom and password support. The PDF Annotator plugin adds the native markup tools of each platform and returns the annotated document. Use the PDF Viewer plugin when users only need to read a document, and the PDF Annotator plugin when they need to mark it up.\n\n### Why is annotation not available on my Android device?\n\nOn Android, annotating PDF documents requires Android 11 (API level 30) or higher and a PDF system module that supports annotations (SDK extension level 18 or higher). This module ships with Android 16 QPR2 and is delivered to older devices via Google Play system updates. Use the `isAvailable()` method to check the availability and hide the annotation feature on unsupported devices.\n\n### Why do I need to set the SDK extension level on Android?\n\nThe Jetpack PDF library used by this plugin declares that depending apps must be compiled against an SDK with extension level 19 or higher. This is enforced by the Android Gradle Plugin, so the build fails without it. Android SDK 36 provides this extension level via the `android-36-ext19` platform (see [SDK Extension Level](#sdk-extension-level)). Changing the compile SDK does not change the runtime behavior of your app, which is controlled by the target SDK version.\n\n### Can I customize the toolbar?\n\nNo, the plugin uses the system markup user interface of each platform, which can not be customized.\n\n### Can I annotate a PDF from a remote URL?\n\nNo, the plugin only supports local files. Download the file first, for example with the `downloadFile(...)` method of the official [Filesystem](https://capacitorjs.com/docs/apis/filesystem) plugin, and then pass the local file path to the `open(...)` method.\n\n### Can I use this plugin with Ionic, React, Vue or Angular?\n\nYes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.\n\n## Related Plugins\n\n- [File Opener](https://capawesome.io/docs/sdks/capacitor/file-opener/): Open a file with the default application instead of an in-app viewer.\n- [File Picker](https://capawesome.io/docs/sdks/capacitor/file-picker/): Let the user select a PDF file from the device's file system.\n- [PDF Generator](https://capawesome.io/docs/sdks/capacitor/pdf-generator/): Generate paginated PDF files from HTML content or URLs.\n- [PDF Viewer](https://capawesome.io/docs/sdks/capacitor/pdf-viewer/): Display PDF documents in a fullscreen native viewer.\n\n## Newsletter\n\nStay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/pdf-annotator/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/pdf-annotator/LICENSE).\n","readmeFilename":"README.md"}