@paperlet/react-native 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ <img src="https://paperlet.ikolvi.com/brand/paperlet-mark.png" alt="Paperlet" width="64">
2
+
1
3
  # @paperlet/react-native
2
4
 
3
5
  Paperlet's PDF SDK for React Native (new architecture). The logic is the compiled Paperlet core (Rust),
@@ -36,6 +38,29 @@ const locked = encryptPdf(doc.save(), 'secret')
36
38
  Page numbers start at 1; rectangles are in PDF points from the bottom-left corner. Close documents
37
39
  with `doc.close()`.
38
40
 
41
+ ## Set up with an AI assistant
42
+
43
+ Paste this into Claude Code, Cursor, Copilot or any coding assistant:
44
+
45
+ ```text
46
+ Add Paperlet to this React Native app (new architecture): PDF viewer, redaction, stamps, password protection and signing.
47
+
48
+ 1. Run: npm install @paperlet/react-native react-native-nitro-modules, then cd ios && pod install
49
+ 2. Set the iOS deployment target to 17.0 or higher and Android minSdkVersion to 24 or higher.
50
+ 3. At startup call initializePaperlet(licenseKey, appId), where appId is the bundle ID / application ID. An empty key works and adds a "Paperlet Pro trial" watermark to paid features.
51
+ 4. Load a PDF into an ArrayBuffer, open it with openDocument(bytes) and show it with <PaperletView document={doc} revision={revision} />; bump revision after changing the document and call doc.close() when done.
52
+ 5. API reference: https://www.npmjs.com/package/@paperlet/react-native
53
+ 6. Build for iOS and Android and fix any errors.
54
+ ```
55
+
56
+ ## Licence
57
+
58
+ Commercial ([LICENSE](LICENSE)). Buy a key at [paperlet.ikolvi.com](https://paperlet.ikolvi.com/#pricing); keys are checked offline and bound to your app ID. Without a key the paid features work and adds a "Paperlet Pro trial" watermark, so you can build and test before buying.
59
+
60
+ ## Links
61
+
62
+ [Website and pricing](https://paperlet.ikolvi.com) · [Licence key](https://paperlet.ikolvi.com/license) · [Issues](https://github.com/Ikolvi/paperlet-sdk/issues)
63
+
39
64
  ## Develop
40
65
 
41
66
  `npm run binaries` copies the prebuilt core from `../paperlet_core/prebuilt` (run its
@@ -36,6 +36,7 @@ std::shared_ptr<HybridPaperletDocumentSpec> HybridPaperlet::open(const std::shar
36
36
 
37
37
  std::shared_ptr<ArrayBuffer> HybridPaperlet::encrypt(const std::shared_ptr<ArrayBuffer>& pdf, const std::string& userPassword,
38
38
  const std::optional<std::string>& ownerPassword, double permissions) {
39
+ std::lock_guard lock(pdfiumLock()); // unlicensed, the core watermarks the pages with PDFium first
39
40
  size_t len = 0;
40
41
  char* err = nullptr;
41
42
  uint8_t* out = pl_encrypt(pdf->data(), pdf->size(), userPassword.c_str(), opt(ownerPassword), (int32_t)permissions, &len, &err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paperlet/react-native",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Paperlet PDF SDK for React Native: viewer, redaction, stamps, compression, encryption, signing, MRZ.",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",