Browse Source

compdfkit(rn) - 注释类型列表不生效问题, 文档补充

liuxiaolong 10 months ago
parent
commit
8368036118
5 changed files with 7 additions and 9 deletions
  1. 3 3
      README.md
  2. 1 3
      example/App.tsx
  3. 1 1
      src/configuration/CPDFConfiguration.ts
  4. 1 1
      src/configuration/CPDFOptions.ts
  5. 1 1
      src/index.tsx

+ 3 - 3
README.md

@@ -22,6 +22,8 @@ APIs are available on the [API](API.md)
 * npm or yarn
 * ComPDFKit SDK => 2.0.1
 * react-native => 0.60.0
+* Android `minSdkVersion` of `21` or higher
+* iOS 11 or higher
 
 
 
@@ -109,12 +111,10 @@ You can integrate the SDK in two ways:
 
 <img src="./screenshots/demo-android-2.png" alt="demo-android-2" style="zoom:33%;" />
 
-2. Replace `App.js` (or `App.tsx`) with what is shown for [NPM](https://www.npmjs.com/package/@pdftron/react-native-pdf?activeTab=readme#Usage-NPM) or [GitHub](https://www.npmjs.com/package/@pdftron/react-native-pdf?activeTab=readme#Usage-Github)
+2. Replace `App.js` (or `App.tsx`) with what is shown for [Usage Example](#Usage Example) 
 
 3. Finally in the root project directory, run `react-native run-android`.
 
-
-
 #### iOS
 
 1. Open your project’s Podfile in a text editor:

+ 1 - 3
example/App.tsx

@@ -58,9 +58,7 @@
    openSample(){
      var samplePDF: string = Platform.OS == 'android' ? 'file:///android_asset/PDF_Document.pdf' : 'PDF_Document.pdf'
      // We provide default UI and PDF property related configurations here, you can modify configuration options according to your needs.
-     var config = ComPDFKit.getDefaultConfig({
-       
-     })
+     var config = ComPDFKit.getDefaultConfig({})
      ComPDFKit.openDocument(samplePDF, '', config)
    }
  

+ 1 - 1
src/configuration/CPDFConfiguration.ts

@@ -83,7 +83,7 @@ export class CPDFConfiguration {
         /**
          * {@link CPDFViewMode.ANNOTATIONS} mode, list of annotation functions shown at the bottom of the view.
          */
-        availableType?: CPDFAnnotationType[],
+        availableTypes?: CPDFAnnotationType[],
         /**
          * {@link CPDFViewMode.ANNOTATIONS} mode, annotation tools shown at the bottom of the view.
          */

+ 1 - 1
src/configuration/CPDFOptions.ts

@@ -352,7 +352,7 @@ export type ColorAlpha = RangeOf2<0,255>
 
 export type BorderWidth = RangeOf2<1, 10>
 
-export type DashGap = RangeOf2<0.0, 8.0>
+export type DashGap = RangeOf2<0.0, 10.0>
 
 export type HexColor = `#${string}`;
 

+ 1 - 1
src/index.tsx

@@ -195,7 +195,7 @@ function getDefaultConfig(overrides : Partial<CPDFConfiguration> = {}) : string
       ]
     },
     annotationsConfig: {
-      availableType: [
+      availableTypes: [
         CPDFAnnotationType.NOTE,
         CPDFAnnotationType.HIGHLIGHT,
         CPDFAnnotationType.UNDERLINE,