diff --git a/DoubleTapView.js b/DoubleTapView.js index f0f38dba..6fea4777 100644 --- a/DoubleTapView.js +++ b/DoubleTapView.js @@ -10,11 +10,10 @@ import React, {Component} from 'react'; import { View, - PanResponder, - ViewPropTypes, + PanResponder } from 'react-native'; import PropTypes from 'prop-types'; - +import {ViewPropTypes} from 'deprecated-react-native-prop-types'; export default class DoubleTapView extends Component { static propTypes = { diff --git a/PdfPageView.js b/PdfPageView.js index 888fc3ad..87bc4525 100644 --- a/PdfPageView.js +++ b/PdfPageView.js @@ -11,10 +11,9 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import { - ViewPropTypes, requireNativeComponent, } from 'react-native'; - +import {ViewPropTypes} from 'deprecated-react-native-prop-types'; export default class PdfPageView extends PureComponent { _getStylePropsProps = () => { const {width, height} = this.props; diff --git a/PdfView.js b/PdfView.js index cd1153d9..02b09c5f 100644 --- a/PdfView.js +++ b/PdfView.js @@ -8,8 +8,8 @@ 'use strict'; import React, {Component} from 'react'; -import {ScrollView, FlatList, View, StyleSheet, ViewPropTypes} from 'react-native'; - +import {ScrollView, View, StyleSheet} from 'react-native'; +import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import PropTypes from 'prop-types'; import PdfManager from './PdfManager'; @@ -40,6 +40,8 @@ export default class PdfView extends Component { singlePage: PropTypes.bool, onPageSingleTap: PropTypes.func, onScaleChanged: PropTypes.func, + showsHorizontalScrollIndicator: PropTypes.bool, + showsVerticalScrollIndicator: PropTypes.bool, }; static defaultProps = { @@ -50,6 +52,7 @@ export default class PdfView extends Component { maxScale: MAX_SCALE, spacing: 10, style: {}, + progressContainerStyle: {}, fitPolicy: 2, horizontal: false, centerContent: false, @@ -61,6 +64,8 @@ export default class PdfView extends Component { }, onScaleChanged: (scale) => { }, + showsHorizontalScrollIndicator: true, + showsVerticalScrollIndicator: true, }; constructor(props) { @@ -413,4 +418,4 @@ const styles = StyleSheet.create({ container: { flex: 1 } -}); \ No newline at end of file +}); diff --git a/PdfViewFlatList.js b/PdfViewFlatList.js index 5fc491ec..444f3f4c 100644 --- a/PdfViewFlatList.js +++ b/PdfViewFlatList.js @@ -7,7 +7,6 @@ */ 'use strict'; -import React, {Component} from 'react'; import { FlatList, } from 'react-native'; @@ -28,4 +27,4 @@ export default class PdfViewFlatList extends FlatList { this._listRef._scrollRef.scrollTo({x: x, y: y, animated: false}); } -} \ No newline at end of file +} diff --git a/PinchZoomView.js b/PinchZoomView.js index 45334800..536fc9ed 100644 --- a/PinchZoomView.js +++ b/PinchZoomView.js @@ -12,10 +12,9 @@ import PropTypes from 'prop-types'; import { View, StyleSheet, - PanResponder, - ViewPropTypes, + PanResponder } from 'react-native'; - +import {ViewPropTypes} from 'deprecated-react-native-prop-types'; export default class PinchZoomView extends Component { static propTypes = { diff --git a/README.md b/README.md index 017e8ca6..71642cac 100644 --- a/README.md +++ b/README.md @@ -114,14 +114,14 @@ in the app `.vcxproj` file, before ``.
FAQ details -Q1. After installation and running, I can not see the pdf file. +Q1. After installation and running, I can not see the pdf file. A1: maybe you forgot to excute ```react-native link``` or it does not run correctly. You can add it manually. For detail you can see the issue [`#24`](https://github.com/wonday/react-native-pdf/issues/24) and [`#2`](https://github.com/wonday/react-native-pdf/issues/2) -Q2. When running, it shows ```'Pdf' has no propType for native prop RCTPdf.acessibilityLabel of native type 'String'``` +Q2. When running, it shows ```'Pdf' has no propType for native prop RCTPdf.acessibilityLabel of native type 'String'``` A2. Your react-native version is too old, please upgrade it to 0.47.0+ see also [`#39`](https://github.com/wonday/react-native-pdf/issues/39) -Q3. When I run the example app I get a white/gray screen / the loading bar isn't progressing . +Q3. When I run the example app I get a white/gray screen / the loading bar isn't progressing . A3. Check your uri, if you hit a pdf that is hosted on a `http` you will need to do the following: **iOS:** @@ -151,10 +151,10 @@ add an exception for the server hosting the pdf in the ios `info.plist`. Here is **Android:** [`see here`](https://stackoverflow.com/questions/54818098/cleartext-http-traffic-not-permitted) -Q4. why doesn't it work with react native expo?. +Q4. why doesn't it work with react native expo?. A4. Expo does not support native module. you can read more expo caveats [`here`](https://facebook.github.io/react-native/docs/getting-started.html#caveats) -Q5. Why can't I run the iOS example? `'Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65.'` +Q5. Why can't I run the iOS example? `'Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65.'` A5. Run the following commands in the project folder (e.g. `react-native-pdf/example`) to ensure that all dependencies are available: ``` yarn install (or npm install) @@ -168,6 +168,59 @@ react-native run-ios ### ChangeLog
ChangeLog details +v6.7.7 +1. Added: add support for customizable scroll indicators in PdfView component (#904) +2. Fixed: fix field values not being visible on android. issue #864 :bug: (#896) + +v6.7.6 +1. Fixed: Add missing 'enableDoubleTapZoom' to fabric codegen source (#832) +2. Fixed: added missing 'scrollEnabled' prop (#842) +3. Fixed: java.lang.IllegalStateException: Tried to access a JS module before the React instance was fully set up (#840) +4. Fixed: an issue that crashes when cancel is not present (#852) +5. Added: add load method (#861) +6. Fixed: encoded accented character is decoded incorrectly (#873) +7. Fixed: enableDoubleTapZoom bugfix + + +v6.7.5 +1. Added progressContainerStyle prop +2. Improved: Added enableDoubleTapZoom option +3. Fixed: Fix app crash with this.lastRNBFTask.cancel is not a function (#827) +4. Fixed: Remove override to fix 'no matching methods to override' error (#822) + +v6.7.4 +1. Fixed: fix Android crash issue + +v6.7.3 +1. Fixed: fix android package name + +v6.7.2 +1. Fixed: fix iOS double tap zoom scrolling +2. Fixed: fix RN 73 compatibility +3. Fixed: bump crypto-js to avoid critical vulnerability + +v6.7.1 +1. Fixed: fix ios project setting +2. Fixed: fix typo in RNPDFPdfViewManagerInterface interface causing android build error + +v6.7.0 +1. Fixed: fix(iOS): center page at tap point after double tap to zoom +2. Fixed: add PDFKit to podspec to make ios compile +3. Improved: Update build.gradle to support RN 0.71 on new arch +4. Fixed: fix some small bugs and documents. + +v6.6.2 +1. Fixed: Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types' +2. Added: Decode File Path for iOS +3. Improved: prefer current page for calculating scale factor on fit + +v6.6.1 depresed + +v6.6.0 depresed +1. Fixed: Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types' +2. Added: Decode File Path for iOS +3. Improved: prefer current page for calculating scale factor on fit +4. Improved: Typescript version source v6.5.0 1. Fix: replace mavenCentral with maven @@ -187,42 +240,6 @@ v6.3.0 1. Add windows support 2. Fixed some bugs -v6.2.2 -1. Fixed incorrect type of onPageSingleTap and onScaleChanged argument -2. Fixed included missing setPage method in TypeScript and Flow types -3. fixed Xcode 12 compatibility - -v6.2.1 -1. Fixed typescript `onLoadComplete()` definition -2. Switched the AndroidPdfViewer dependency from Barteksc repo to TalbotGooday -3. Add singlePage property - -v6.2.0 -1. Fixed ReferenceError, url should be source.uri -2. Dependency bump to support React-Native >= 0.62 - -v6.1.2 -1. Fixed wrong scale returned from onScaleChanged() -2. Fixed iOS Double Tap zoom -3. Fixed Some critical typo fixes - -v6.1.1 -1. Fixed undefined is not an object, crashing on ios - -v6.1.0 -1. Fixed react-native warning on `componentWill*` -2. Fixed onPageSingleTap -3. Set the PDF View background color to be transparent On iOS - -v6.0.1 -1. Expose prop to trust self-signed SSL certs -2. Use ViewStyleProp in index.js.flow, not deprecated StyleSheet.Styles - -v6.0.0 -1. Add JS callback onPressLink for pdf link press listener -2. Fix calling setState while unmounted - - [[more]](https://github.com/wonday/react-native-pdf/releases)
@@ -293,33 +310,38 @@ const styles = StyleSheet.create({ ### Configuration -| Property | Type | Default | Description | iOS | Android | Windows | FirstRelease | -| ------------- |:-------------:|:----------------:| ------------------- | ------| ------- | ------- | ------------ | -| source | object | not null | PDF source like {uri:xxx, cache:false}. see the following for detail.| ✔ | ✔ | ✔ | <3.0 | -| page | number | 1 | initial page index | ✔ | ✔ | ✔ | <3.0 | -| scale | number | 1.0 | should minScale<=scale<=maxScale| ✔ | ✔ | ✔ | <3.0 | -| minScale | number | 1.0 | min scale| ✔ | ✔ | ✔ | 5.0.5 | -| maxScale | number | 3.0 | max scale| ✔ | ✔ | ✔ | 5.0.5 | -| horizontal | bool | false | draw page direction, if you want to listen the orientation change, you can use [[react-native-orientation-locker]](https://github.com/wonday/react-native-orientation-locker)| ✔ | ✔ | ✔ | <3.0 | -| fitWidth | bool | false | if true fit the width of view, can not use fitWidth=true together with scale| ✔ | ✔ | ✔ | <3.0, abandoned from 3.0 | -| fitPolicy | number | 2 | 0:fit width, 1:fit height, 2:fit both(default)| ✔ | ✔ | ✔ | 3.0 | -| spacing | number | 10 | the breaker size between pages| ✔ | ✔ | ✔ | <3.0 | -| password | string | "" | pdf password, if password error, will call OnError() with message "Password required or incorrect password." | ✔ | ✔ | ✔ | <3.0 | -| style | object | {backgroundColor:"#eee"} | support normal view style, you can use this to set border/spacing color... | ✔ | ✔ | ✔ | <3.0 | -| renderActivityIndicator | (progress) => Component | | when loading show it as an indicator, you can use your component| ✔ | ✔ | ✖ | <3.0 | -| enableAntialiasing | bool | true | improve rendering a little bit on low-res screens, but maybe course some problem on Android 4.4, so add a switch | ✖ | ✔ | ✖ | <3.0 | -| enablePaging | bool | false | only show one page in screen | ✔ | ✔ | ✔ | 5.0.1 | -| enableRTL | bool | false | scroll page as "page3, page2, page1" | ✔ | ✖ | ✔ | 5.0.1 | -| enableAnnotationRendering | bool | true | enable rendering annotation, notice:iOS only support initial setting,not support realtime changing | ✔ | ✔ | ✖ | 5.0.3 | -| trustAllCerts | bool | true | Allow connections to servers with self-signed certification | ✔ | ✔ | ✖ | 6.0.? | -| singlePage | bool | false | Only show first page, useful for thumbnail views | ✔ | ✔ | ✔ | 6.2.1 | -| onLoadProgress | function(percent) | null | callback when loading, return loading progress (0-1) | ✔ | ✔ | ✖ | <3.0 | -| onLoadComplete | function(numberOfPages, path, {width, height}, tableContents) | null | callback when pdf load completed, return total page count, pdf local/cache path, {width,height} and table of contents | ✔ | ✔ | ✔ but without tableContents | <3.0 | -| onPageChanged | function(page,numberOfPages) | null | callback when page changed ,return current page and total page count | ✔ | ✔ | ✔ | <3.0 | -| onError | function(error) | null | callback when error happened | ✔ | ✔ | ✔ | <3.0 | -| onPageSingleTap | function(page) | null | callback when page was single tapped | ✔ | ✔ | ✔ | 3.0 | -| onScaleChanged | function(scale) | null | callback when scale page | ✔ | ✔ | ✔ | 3.0 | -| onPressLink | function(uri) | null | callback when link tapped | ✔ | ✔ | ✖ | 6.0.0 | +| Property | Type | Default | Description | iOS | Android | Windows | FirstRelease | +| ------------------------------ | :-----------------------------------------------------------: | :----------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------- | --------------------------- | ------------------------ | +| source | object | not null | PDF source like {uri:xxx, cache:false}. see the following for detail. | ✔ | ✔ | ✔ | <3.0 | +| page | number | 1 | initial page index | ✔ | ✔ | ✔ | <3.0 | +| scale | number | 1.0 | should minScale<=scale<=maxScale | ✔ | ✔ | ✔ | <3.0 | +| minScale | number | 1.0 | min scale | ✔ | ✔ | ✔ | 5.0.5 | +| maxScale | number | 3.0 | max scale | ✔ | ✔ | ✔ | 5.0.5 | +| horizontal | bool | false | draw page direction, if you want to listen the orientation change, you can use [[react-native-orientation-locker]](https://github.com/wonday/react-native-orientation-locker) | ✔ | ✔ | ✔ | <3.0 | +| showsHorizontalScrollIndicator | bool | true | shows or hides the horizontal scroll bar indicator on iOS | ✔ | | | 6.6 | +| showsVerticalScrollIndicator | bool | true | shows or hides the vertical scroll bar indicator on iOS | ✔ | | | 6.6 | +| scrollEnabled | bool | true | enable or disable scroll | ✔ | | | 6.6 | +| fitWidth | bool | false | if true fit the width of view, can not use fitWidth=true together with scale | ✔ | ✔ | ✔ | <3.0, abandoned from 3.0 | +| fitPolicy | number | 2 | 0:fit width, 1:fit height, 2:fit both(default) | ✔ | ✔ | ✔ | 3.0 | +| spacing | number | 10 | the breaker size between pages | ✔ | ✔ | ✔ | <3.0 | +| password | string | "" | pdf password, if password error, will call OnError() with message "Password required or incorrect password." | ✔ | ✔ | ✔ | <3.0 | +| style | object | {backgroundColor:"#eee"} | support normal view style, you can use this to set border/spacing color... | ✔ | ✔ | ✔ | <3.0 +| progressContainerStyle | object | {backgroundColor:"#eee"} | support normal view style, you can use this to set border/spacing color... | ✔ | ✔ | ✔ | 6.9.0 | +| renderActivityIndicator | (progress) => Component | | when loading show it as an indicator, you can use your component | ✔ | ✔ | ✖ | <3.0 | +| enableAntialiasing | bool | true | improve rendering a little bit on low-res screens, but maybe course some problem on Android 4.4, so add a switch | ✖ | ✔ | ✖ | <3.0 | +| enablePaging | bool | false | only show one page in screen | ✔ | ✔ | ✔ | 5.0.1 | +| enableRTL | bool | false | scroll page as "page3, page2, page1" | ✔ | ✖ | ✔ | 5.0.1 | +| enableAnnotationRendering | bool | true | enable rendering annotation, notice:iOS only support initial setting,not support realtime changing | ✔ | ✔ | ✖ | 5.0.3 | +| enableDoubleTapZoom | bool | true | Enable double tap to zoom gesture | ✔ | ✔ | ✖ | 6.8.0 | +| trustAllCerts | bool | true | Allow connections to servers with self-signed certification | ✔ | ✔ | ✖ | 6.0.? | +| singlePage | bool | false | Only show first page, useful for thumbnail views | ✔ | ✔ | ✔ | 6.2.1 | +| onLoadProgress | function(percent) | null | callback when loading, return loading progress (0-1) | ✔ | ✔ | ✖ | <3.0 | +| onLoadComplete | function(numberOfPages, path, {width, height}, tableContents) | null | callback when pdf load completed, return total page count, pdf local/cache path, {width,height} and table of contents | ✔ | ✔ | ✔ but without tableContents | <3.0 | +| onPageChanged | function(page,numberOfPages) | null | callback when page changed ,return current page and total page count | ✔ | ✔ | ✔ | <3.0 | +| onError | function(error) | null | callback when error happened | ✔ | ✔ | ✔ | <3.0 | +| onPageSingleTap | function(page) | null | callback when page was single tapped | ✔ | ✔ | ✔ | 3.0 | +| onScaleChanged | function(scale) | null | callback when scale page | ✔ | ✔ | ✔ | 3.0 | +| onPressLink | function(uri) | null | callback when link tapped | ✔ | ✔ | ✖ | 6.0.0 | #### parameters of source @@ -369,4 +391,4 @@ Set the current page of the PDF component. pageNumber is a positive integer. If Example: ``` this.pdf.setPage(42); // Display the answer to the Ultimate Question of Life, the Universe, and Everything -``` +``` \ No newline at end of file diff --git a/android/.classpath b/android/.classpath new file mode 100644 index 00000000..0a3280e2 --- /dev/null +++ b/android/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/android/.project b/android/.project new file mode 100644 index 00000000..065bc1ad --- /dev/null +++ b/android/.project @@ -0,0 +1,34 @@ + + + react-native-pdf + Project react-native-pdf created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1759485309693 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..16754904 --- /dev/null +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../../android +eclipse.preferences.version=1 diff --git a/android/build.gradle b/android/build.gradle index a5e320e5..475e3766 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,46 +1,105 @@ description = 'react-native-pdf' buildscript { + ext.safeExtGet = { prop, fallback -> + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback + } repositories { mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath("com.android.tools.build:gradle:7.4.2") } } repositories { mavenCentral() maven { - url 'https://jitpack.io' + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$projectDir/../node_modules/react-native/android" content { // Use Jitpack only for AndroidPdfViewer; the rest is hosted at mavenCentral. - includeGroup "com.github.TalbotGooday" + includeGroup "com.github.zacharee" } } + maven { url 'https://jitpack.io' } + google() } apply plugin: 'com.android.library' -def _ext = rootProject.ext +def resolveReactNativeDirectory() { + def reactNativeLocation = safeExtGet("REACT_NATIVE_NODE_MODULES_DIR", null) + if (reactNativeLocation != null) { + return file(reactNativeLocation) + } + + // monorepo workaround + // react-native can be hoisted or in project's own node_modules + def reactNativeFromProjectNodeModules = file("${rootProject.projectDir}/../node_modules/react-native") + if (reactNativeFromProjectNodeModules.exists()) { + return reactNativeFromProjectNodeModules + } + + def reactNativeFromNodeModulesWithPDF = file("${projectDir}/../../react-native") + if (reactNativeFromNodeModulesWithPDF.exists()) { + return reactNativeFromNodeModulesWithPDF + } + + throw new Exception( + "[react-native-pdf] Unable to resolve react-native location in " + + "node_modules. You should add project extension property (in app/build.gradle) " + + "`REACT_NATIVE_NODE_MODULES_DIR` with path to react-native." + ) +} -def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+' -def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 28 -def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '28.0.3' -def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16 -def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 28 +def getReactNativeMinorVersion() { + def REACT_NATIVE_DIR = resolveReactNativeDirectory() + def reactProperties = new Properties() + file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } + def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME") + def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger() + + return REACT_NATIVE_MINOR_VERSION +} + +def isNewArchitectureEnabled() { + // To opt-in for the New Architecture, you can either: + // - Set `newArchEnabled` to true inside the `gradle.properties` file + // - Invoke gradle with `-newArchEnabled=true` + // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` + return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" +} + +if (isNewArchitectureEnabled()) { + apply plugin: "com.facebook.react" +} android { - compileSdkVersion _compileSdkVersion - buildToolsVersion _buildToolsVersion + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (agpVersion.tokenize('.')[0].toInteger() >= 7) { + namespace "org.wonday.pdf" + } + compileSdkVersion safeExtGet('compileSdkVersion', 31) defaultConfig { - minSdkVersion _minSdkVersion - targetSdkVersion _targetSdkVersion + minSdkVersion safeExtGet('minSdkVersion', 21) + targetSdkVersion safeExtGet('targetSdkVersion', 31) + buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()) + } + + sourceSets.main { + java { + if (!isNewArchitectureEnabled()) { + srcDirs += [ + "src/paper/java", + ] + } + } } lintOptions { @@ -48,19 +107,25 @@ android { } packagingOptions { - pickFirst 'lib/x86/libc++_shared.so' - pickFirst 'lib/x86_64/libjsc.so' - pickFirst 'lib/x86_64/libc++_shared.so' - pickFirst 'lib/arm64-v8a/libjsc.so' - pickFirst 'lib/arm64-v8a/libc++_shared.so' - pickFirst 'lib/armeabi-v7a/libc++_shared.so' + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libjsc.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/arm64-v8a/libjsc.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so' } } dependencies { - implementation "com.facebook.react:react-native:${_reactNativeVersion}" + if (isNewArchitectureEnabled() && getReactNativeMinorVersion() < 71) { + implementation project(":ReactAndroid") + } else { + implementation 'com.facebook.react:react-native:+' + } // NOTE: The original repo at com.github.barteksc is abandoned by the maintainer; there will be no more updates coming from that repo. - // It was taken over by com.github.TalbotGooday; from now on please use this repo until (if ever) the Barteksc repo is resumed. - implementation 'com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3' - implementation 'com.google.code.gson:gson:2.8.5' + // The repo from zacharee is based on PdfiumAndroidKt, a much newer fork of PdfiumAndroid, with better maintenance and updated native libraries. + implementation 'com.github.maribeiroleya:AndroidPdfViewer:leya_2.1.2' + // Depend on PdfiumAndroidKt directly so this can be updated independently of AndroidPdfViewer as updates are provided. + implementation 'io.legere:pdfiumandroid:1.0.33' + implementation 'com.google.code.gson:gson:2.13.2' } diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 00000000..646c51b9 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..d64cd491 Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties similarity index 74% rename from example/android/gradle/wrapper/gradle-wrapper.properties rename to android/gradle/wrapper/gradle-wrapper.properties index ee69dd68..1af9e093 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew new file mode 100644 index 00000000..1aa94a42 --- /dev/null +++ b/android/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/example/android/gradlew.bat b/android/gradlew.bat similarity index 76% rename from example/android/gradlew.bat rename to android/gradlew.bat index 15e1ee37..93e3f59f 100644 --- a/example/android/gradlew.bat +++ b/android/gradlew.bat @@ -1,100 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 6cdd2f72..44b04cec 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + - \ No newline at end of file + diff --git a/android/src/main/java/org/wonday/pdf/PdfManager.java b/android/src/main/java/org/wonday/pdf/PdfManager.java new file mode 100644 index 00000000..ff1cdcb6 --- /dev/null +++ b/android/src/main/java/org/wonday/pdf/PdfManager.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +package org.wonday.pdf; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.facebook.infer.annotation.Assertions; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.module.annotations.ReactModule; +import com.facebook.react.uimanager.SimpleViewManager; +import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.react.uimanager.annotations.ReactProp; + +import com.facebook.react.uimanager.ViewManagerDelegate; +import com.facebook.react.viewmanagers.RNPDFPdfViewManagerDelegate; +import com.facebook.react.viewmanagers.RNPDFPdfViewManagerInterface; + +@ReactModule(name = PdfManager.REACT_CLASS) +public class PdfManager extends SimpleViewManager implements RNPDFPdfViewManagerInterface { + public static final String REACT_CLASS = "RNPDFPdfView"; + private Context context; + private PdfView pdfView; + private final ViewManagerDelegate mDelegate; + + @Nullable + @Override + protected ViewManagerDelegate getDelegate() { + return mDelegate; + } + + public PdfManager() { + mDelegate = new RNPDFPdfViewManagerDelegate<>(this); + } + + public PdfManager(ReactApplicationContext reactContext){ + this.context = reactContext; + mDelegate = new RNPDFPdfViewManagerDelegate<>(this); + } + + @Override + public String getName() { + return REACT_CLASS; + } + + @Override + public PdfView createViewInstance(ThemedReactContext context) { + this.pdfView = new PdfView(context,null); + return pdfView; + } + + @Override + public void onDropViewInstance(PdfView pdfView) { + pdfView = null; + } + + @ReactProp(name = "path") + public void setPath(PdfView pdfView, String path) { + pdfView.setPath(path); + } + + @ReactProp(name = "hotspots") + public void setHotspots(PdfView pdfView, String hotspots) { + pdfView.setHotspotsString(hotspots); + } + + @ReactProp(name = "notes") + public void setNotes(PdfView pdfView, String notes) { + pdfView.setNotesString(notes); + } + + @ReactProp(name = "textNotes") + public void setTextNotes(PdfView pdfView, String textNotes) { + pdfView.setTextNotesString(textNotes); + } + + // page start from 1 + @ReactProp(name = "page") + public void setPage(PdfView pdfView, int page) { + pdfView.setPage(page); + } + + @ReactProp(name = "scale") + public void setScale(PdfView pdfView, float scale) { + pdfView.setScale(scale); + } + + @ReactProp(name = "minScale") + public void setMinScale(PdfView pdfView, float minScale) { + pdfView.setMinScale(minScale); + } + + @ReactProp(name = "maxScale") + public void setMaxScale(PdfView pdfView, float maxScale) { + pdfView.setMaxScale(maxScale); + } + + @ReactProp(name = "horizontal") + public void setHorizontal(PdfView pdfView, boolean horizontal) { + pdfView.setHorizontal(horizontal); + } + + @Override + public void setShowsHorizontalScrollIndicator(PdfView view, boolean value) { + // NOOP on Android + } + + @Override + public void setShowsVerticalScrollIndicator(PdfView view, boolean value) { + // NOOP on Android + } + + @ReactProp(name = "scrollEnabled") + public void setScrollEnabled(PdfView view, boolean scrollEnabled) { + pdfView.setScrollEnabled(scrollEnabled); + } + + @ReactProp(name = "spacing") + public void setSpacing(PdfView pdfView, int spacing) { + pdfView.setSpacing(spacing); + } + + @ReactProp(name = "password") + public void setPassword(PdfView pdfView, String password) { + pdfView.setPassword(password); + } + + @ReactProp(name = "enableAntialiasing") + public void setEnableAntialiasing(PdfView pdfView, boolean enableAntialiasing) { + pdfView.setEnableAntialiasing(enableAntialiasing); + } + + @ReactProp(name = "enableAnnotationRendering") + public void setEnableAnnotationRendering(PdfView pdfView, boolean enableAnnotationRendering) { + pdfView.setEnableAnnotationRendering(enableAnnotationRendering); + } + + @ReactProp(name = "enableDoubleTapZoom") + public void setEnableDoubleTapZoom(PdfView pdfView, boolean enableDoubleTap) { + pdfView.setEnableDoubleTapZoom(enableDoubleTap); + } + + @ReactProp(name = "enablePaging") + public void setEnablePaging(PdfView pdfView, boolean enablePaging) { + pdfView.setEnablePaging(enablePaging); + } + + @Override + public void setEnableRTL(PdfView view, boolean value) { + // NOOP on Android + } + + @ReactProp(name = "fitPolicy") + public void setFitPolicy(PdfView pdfView, int fitPolicy) { + pdfView.setFitPolicy(fitPolicy); + } + + @ReactProp(name = "singlePage") + public void setSinglePage(PdfView pdfView, boolean singlePage) { + pdfView.setSinglePage(singlePage); + } + + // It seems funny, but this method is called through delegate on Paper, but on Fabric we need to + // use `receiveCommand` method and call this one there + @Override + public void setNativePage(PdfView view, int page) { + pdfView.setPage(page); + } + + @Override + public void receiveCommand(@NonNull PdfView root, String commandId, @androidx.annotation.Nullable ReadableArray args) { + Assertions.assertNotNull(root); + if ("setNativePage".equals(commandId)) { + Assertions.assertNotNull(args); + assert args != null; + setNativePage(root, args.getInt(0)); + } + } + + + @ReactProp(name = "enableMovement") + public void setEnableMovement(PdfView pdfView, boolean enableMovement) { + pdfView.updateMovement(enableMovement); + } + + + @Override + public void onAfterUpdateTransaction(PdfView pdfView) { + super.onAfterUpdateTransaction(pdfView); + pdfView.drawPdf(); + } + +} diff --git a/android/src/main/java/org/wonday/pdf/PdfView.java b/android/src/main/java/org/wonday/pdf/PdfView.java index d87ae281..4c57e91a 100644 --- a/android/src/main/java/org/wonday/pdf/PdfView.java +++ b/android/src/main/java/org/wonday/pdf/PdfView.java @@ -12,22 +12,24 @@ import android.content.ContentResolver; import android.content.Context; +import android.util.SizeF; import android.view.View; import android.view.ViewGroup; import android.util.Log; -import android.graphics.PointF; import android.net.Uri; import android.util.AttributeSet; import android.view.MotionEvent; import android.graphics.Canvas; -import javax.annotation.Nullable; +import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.react.uimanager.UIManagerHelper; import com.github.barteksc.pdfviewer.PDFView; +import com.github.barteksc.pdfviewer.listener.OnActionEnd; import com.github.barteksc.pdfviewer.listener.OnPageChangeListener; import com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener; import com.github.barteksc.pdfviewer.listener.OnErrorListener; -import com.github.barteksc.pdfviewer.listener.OnRenderListener; +import com.github.barteksc.pdfviewer.listener.OnPageSwipeChangeListener; import com.github.barteksc.pdfviewer.listener.OnTapListener; import com.github.barteksc.pdfviewer.listener.OnDrawListener; import com.github.barteksc.pdfviewer.listener.OnPageScrollListener; @@ -36,43 +38,53 @@ import com.github.barteksc.pdfviewer.link.LinkHandler; import com.github.barteksc.pdfviewer.model.LinkTapEvent; -import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.WritableMap; -import com.facebook.react.uimanager.SimpleViewManager; -import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.react.uimanager.annotations.ReactProp; +import com.facebook.react.bridge.ReactContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.events.EventDispatcher; +import com.facebook.react.uimanager.events.Event; import com.facebook.react.uimanager.events.RCTEventEmitter; -import com.facebook.react.common.MapBuilder; -import com.facebook.react.modules.core.DeviceEventManagerModule; -import com.facebook.common.logging.FLog; -import com.facebook.react.common.ReactConstants; + import static java.lang.String.format; import java.io.FileNotFoundException; import java.io.InputStream; -import java.lang.ClassCastException; +import java.util.ArrayList; +import java.util.List; -import com.shockwave.pdfium.PdfDocument; -import com.google.gson.Gson; +import com.github.barteksc.pdfviewer.util.Hotspot; +import com.github.barteksc.pdfviewer.util.Note; +import com.github.barteksc.pdfviewer.util.TextLine; +import com.github.barteksc.pdfviewer.util.TextNote; import com.google.gson.GsonBuilder; -import com.shockwave.pdfium.util.SizeF; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.Gson; +import com.google.gson.JsonObject; + +import org.wonday.pdf.events.TopChangeEvent; -public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompleteListener,OnErrorListener,OnTapListener,OnDrawListener,OnPageScrollListener, LinkHandler { - private ThemedReactContext context; +public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompleteListener,OnErrorListener,OnTapListener,OnDrawListener,OnPageScrollListener, LinkHandler, OnPageSwipeChangeListener, OnActionEnd { private int page = 1; // start from 1 private boolean horizontal = false; private float scale = 1; private float minScale = 1; private float maxScale = 3; - private String asset; private String path; + private String hotspotsString; + private String notesString; + private String textNotesString; + private boolean alreadyDraw; + private boolean scaleChange; private int spacing = 10; private String password = ""; private boolean enableAntialiasing = true; private boolean enableAnnotationRendering = true; + private boolean enableDoubleTapZoom = true; private boolean enablePaging = false; private boolean autoSpacing = false; @@ -80,17 +92,23 @@ public class PdfView extends PDFView implements OnPageChangeListener,OnLoadCompl private boolean pageSnap = false; private FitPolicy fitPolicy = FitPolicy.WIDTH; private boolean singlePage = false; - - private static PdfView instance = null; + private boolean scrollEnabled = true; private float originalWidth = 0; private float lastPageWidth = 0; private float lastPageHeight = 0; - public PdfView(ThemedReactContext context, AttributeSet set){ - super(context,set); - this.context = context; - this.instance = this; + // used to store the parameters for `super.onSizeChanged` + private int oldW = 0; + private int oldH = 0; + + + private boolean alreadyLoaded = false; + + public PdfView(Context context, AttributeSet set){ + super(context, set); + this.alreadyDraw = false; + this.scaleChange = false; } @Override @@ -102,12 +120,44 @@ public void onPageChanged(int page, int numberOfPages) { WritableMap event = Arguments.createMap(); event.putString("message", "pageChanged|"+page+"|"+numberOfPages); - ReactContext reactContext = (ReactContext)this.getContext(); - reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( - this.getId(), - "topChange", - event - ); + + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + +// ReactContext reactContext = (ReactContext)this.getContext(); +// reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( +// this.getId(), +// "topChange", +// event +// ); + } + + // In some cases Yoga (I think) will measure the view only along one axis first, resulting in + // onSizeChanged being called with either w or h set to zero. This in turn starts the rendering + // of the pdf under the hood with one dimension being set to zero and the follow-up call to + // onSizeChanged with the correct dimensions doesn't have any effect on the already started process. + // The offending class is DecodingAsyncTask, which tries to get width and height of the pdfView + // in the constructor, and is created as soon as the measurement is complete, which in some cases + // may be incomplete as described above. + // By delaying calling super.onSizeChanged until the size in both dimensions is correct we are able + // to prevent this from happening. + // + // I'm not sure whether the second condition is necessary, but without it, it would be impossible + // to set the dimensions to zero after first measurement. + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + if ((w > 0 && h > 0) || this.oldW > 0 || this.oldH > 0) { + super.onSizeChanged(w, h, this.oldW, this.oldH); + this.oldW = w; + this.oldH = h; + } } @Override @@ -122,12 +172,26 @@ public void loadComplete(int numberOfPages) { //create a new json Object for the TableOfContents Gson gson = new Gson(); event.putString("message", "loadComplete|"+numberOfPages+"|"+width+"|"+height+"|"+gson.toJson(this.getTableOfContents())); - ReactContext reactContext = (ReactContext)this.getContext(); - reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( - this.getId(), - "topChange", - event - ); + + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + + + this.alreadyLoaded = true; + + // ReactContext reactContext = (ReactContext)this.getContext(); +// reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( +// this.getId(), +// "topChange", +// event +// ); //Log.e("ReactNative", gson.toJson(this.getTableOfContents())); @@ -142,43 +206,81 @@ public void onError(Throwable t){ event.putString("message", "error|"+t.getMessage()); } - ReactContext reactContext = (ReactContext)this.getContext(); - reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( - this.getId(), - "topChange", - event - ); + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + +// ReactContext reactContext = (ReactContext)this.getContext(); +// reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( +// this.getId(), +// "topChange", +// event +// ); } @Override public void onPageScrolled(int page, float positionOffset){ - // maybe change by other instance, restore zoom setting + WritableMap event = Arguments.createMap(); + event.putString("message", "pageScrolled|"+(this.getCurrentXOffset())+"|"+(this.getCurrentYOffset())+"|"+(positionOffset)); + + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + Constants.Pinch.MINIMUM_ZOOM = this.minScale; Constants.Pinch.MAXIMUM_ZOOM = this.maxScale; - } + @Override - public boolean onTap(MotionEvent e){ + public void onPageScrolledEnd(float zoom) { + SizeF pageSize = getPageSize(0); + float width = pageSize.getWidth(); + float height = pageSize.getHeight(); + + WritableMap event = Arguments.createMap(); + event.putString("message", "pageScrolledEnd|"+(this.getCurrentXOffset())+"|"+(this.getCurrentYOffset())+"|"+width+"|"+height+"|"+zoom); + + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + } - // maybe change by other instance, restore zoom setting - //Constants.Pinch.MINIMUM_ZOOM = this.minScale; - //Constants.Pinch.MAXIMUM_ZOOM = this.maxScale; + @Override + public boolean onTap(MotionEvent e){ WritableMap event = Arguments.createMap(); - event.putString("message", "pageSingleTap|"+page+"|"+e.getX()+"|"+e.getY()); + event.putString("message", "pageSingleTap|"+page+"|"+e.getX()+"|"+e.getY()+"|"+getWidth()+"|"+getHeight()); - ReactContext reactContext = (ReactContext)this.getContext(); - reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( - this.getId(), - "topChange", - event - ); + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); - // process as tap - return true; + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + return true; } @Override @@ -194,13 +296,21 @@ public void onLayerDrawn(Canvas canvas, float pageWidth, float pageHeight, int d WritableMap event = Arguments.createMap(); event.putString("message", "scaleChanged|"+(pageWidth/originalWidth)); + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); - ReactContext reactContext = (ReactContext)this.getContext(); - reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( - this.getId(), - "topChange", - event - ); + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } +// ReactContext reactContext = (ReactContext)this.getContext(); +// reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( +// this.getId(), +// "topChange", +// event +// ); } lastPageWidth = pageWidth; @@ -214,74 +324,223 @@ protected void onAttachedToWindow() { this.drawPdf(); } - public void drawPdf() { - showLog(format("drawPdf path:%s %s", this.path, this.page)); - if (this.path != null){ + protected List constructNotes() { + List notes = new ArrayList<>(); + if(this.notesString != null && !this.notesString.isEmpty()) { + JsonArray array = stringToArray(this.notesString); + for(JsonElement element : array) { + JsonObject object = element.getAsJsonObject(); + Note note = new Note(Double.valueOf(object.get("xPos").getAsString()).doubleValue(), Double.valueOf(object.get("yPos").getAsString()).doubleValue(), object.get("color").getAsString()); + notes.add(note); + } + } + return notes; + } + - // set scale - this.setMinZoom(this.minScale); - this.setMaxZoom(this.maxScale); - this.setMidZoom((this.maxScale+this.minScale)/2); - Constants.Pinch.MINIMUM_ZOOM = this.minScale; - Constants.Pinch.MAXIMUM_ZOOM = this.maxScale; + protected List constructHotspots() { + List hotspots = new ArrayList<>(); + if(!this.hotspotsString.isEmpty()) { + JsonArray array = stringToArray(this.hotspotsString); + for(JsonElement element : array) { + JsonObject object = element.getAsJsonObject(); + Hotspot hotspot = new Hotspot(Double.valueOf(object.get("xPos").getAsString()).doubleValue(), Double.valueOf(object.get("yPos").getAsString()).doubleValue(), object.get("type").getAsString()); + hotspots.add(hotspot); + } + } + return hotspots; + } - Configurator configurator; - if (this.path.startsWith("content://")) { - ContentResolver contentResolver = getContext().getContentResolver(); - InputStream inputStream = null; - Uri uri = Uri.parse(this.path); - try { - inputStream = contentResolver.openInputStream(uri); - } catch (FileNotFoundException e) { - throw new RuntimeException(e.getMessage()); + protected List constructTextNotes() { + List textNotes = new ArrayList<>(); + if(this.textNotesString != null && !this.textNotesString.isEmpty()) { + JsonArray array = stringToArray(this.textNotesString); + for(JsonElement element : array) { + JsonObject object = element.getAsJsonObject(); + List lines = new ArrayList<>(); + String text = ""; + int count = 0; + for(JsonElement lineElement : object.getAsJsonArray("lines")) { + JsonObject objectLine = lineElement.getAsJsonObject(); + if(count != 0) { + text += '\n'; + } + text += objectLine.get("text").getAsString(); + count++; } - configurator = this.fromStream(inputStream); - } else { - configurator = this.fromUri(getURI(this.path)); + if(!text.equals("") && object.getAsJsonArray("lines").size() > 0) { + JsonObject objectLine = object.getAsJsonArray("lines").get(0).getAsJsonObject(); + TextLine line = new TextLine( + Double.valueOf(objectLine.get("fontSize").getAsString()).doubleValue(), + objectLine.get("fontColor").getAsString(), + Double.valueOf(objectLine.get("fontOpacity").getAsString()).floatValue(), + text); + lines.add(line); + } + TextNote note = new TextNote( + Double.valueOf(object.get("xPos").getAsString()).doubleValue(), + Double.valueOf(object.get("yPos").getAsString()).doubleValue(), + Double.valueOf(object.get("width").getAsString()).doubleValue(), + Double.valueOf(object.get("height").getAsString()).doubleValue(), + object.get("backgroundColor").getAsString(), + Double.valueOf(object.get("backgroundOpacity").getAsString()).floatValue(), + object.get("borderColor").getAsString(), + object.get("borderSize").getAsInt(), + Double.valueOf(object.get("borderOpacity").getAsString()).floatValue(), + lines); + textNotes.add(note); } + } + return textNotes; + } - configurator.defaultPage(this.page-1) - .swipeHorizontal(this.horizontal) - .onPageChange(this) - .onLoad(this) - .onError(this) - .onDraw(this) - .onPageScroll(this) - .spacing(this.spacing) - .password(this.password) - .enableAntialiasing(this.enableAntialiasing) - .pageFitPolicy(this.fitPolicy) - .pageSnap(this.pageSnap) - .autoSpacing(this.autoSpacing) - .pageFling(this.pageFling) - .enableSwipe(!this.singlePage) - .enableDoubletap(!this.singlePage) - .enableAnnotationRendering(this.enableAnnotationRendering) - .linkHandler(this); - - if (this.singlePage) { - configurator.pages(this.page-1); - setTouchesEnabled(false); - } else { - configurator.onTap(this); + + public void updateMovement(boolean enableMovement) { + this.enableMovement(enableMovement); + } + + + public void drawAll() { + if(this.alreadyLoaded) { + if(this.alreadyDraw) { + this.zoomWithAnimation(this.scale); } + } + } - configurator.load(); + public void drawPdf() { + showLog(format("drawPdf path:%s %s", this.path, this.page)); + if(this.alreadyDraw) { + if(this.scaleChange) { + this.zoomWithAnimation(this.scale); + this.scaleChange = false; + } + else { + List notes = constructNotes(); + this.setNotes(notes); + List textNotes = constructTextNotes(); + this.setTextNotes(textNotes); + List hotspots = constructHotspots(); + this.setHotspots(hotspots); + this.redraw(); + } } + else { + if (this.path != null) { + + // set scale + this.setMinZoom(this.minScale); + this.setMaxZoom(this.maxScale); + this.setMidZoom((this.maxScale + this.minScale) / 2); + Constants.Pinch.MINIMUM_ZOOM = this.minScale; + Constants.Pinch.MAXIMUM_ZOOM = this.maxScale; + + Configurator configurator; + + if (this.path.startsWith("content://")) { + ContentResolver contentResolver = getContext().getContentResolver(); + InputStream inputStream = null; + Uri uri = Uri.parse(this.path); + try { + inputStream = contentResolver.openInputStream(uri); + } catch (FileNotFoundException e) { + throw new RuntimeException(e.getMessage()); + } + configurator = this.fromStream(inputStream); + } else { + configurator = this.fromUri(getURI(this.path)); + } + + List hotspots = constructHotspots(); + List notes = constructNotes(); + List textNotes = constructTextNotes(); + + configurator.defaultPage(this.page - 1) + .swipeHorizontal(this.horizontal) + .withHotspots(hotspots) + .withNotes(notes) + .withTextNotes(textNotes) + .onActionEnd(this) + .onPageChange(this) + .onLoad(this) + .onError(this) + .onDraw(this) + .onPageScroll(this) + .onPageSwipeChange(this) + .spacing(this.spacing) + .password(this.password) + .enableAntialiasing(this.enableAntialiasing) + .pageFitPolicy(this.fitPolicy) + .pageSnap(this.pageSnap) + .autoSpacing(this.autoSpacing) + .pageFling(this.pageFling) + .enableSwipe(!this.singlePage && this.scrollEnabled) + .enableDoubletap(!this.singlePage && this.enableDoubleTapZoom) + .enableAnnotationRendering(this.enableAnnotationRendering) + .linkHandler(this); + + if (this.singlePage) { + configurator.pages(this.page - 1); + setTouchesEnabled(false); + } else { + configurator.onTap(this); + } + + configurator.load(); + + this.alreadyDraw = true; + } + } + } + + public static JsonArray stringToArray(String string) { + Gson gson = new GsonBuilder() + .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .setPrettyPrinting() + .disableHtmlEscaping() + .create(); + return gson.fromJson(string, JsonArray.class); + } + + public void setEnableDoubleTapZoom(boolean enableDoubleTapZoom) { + this.enableDoubleTapZoom = enableDoubleTapZoom; } public void setPath(String path) { this.path = path; } + public void setHotspotsString(String hotspotsString) { + this.hotspotsString = hotspotsString; + } + + public void setNotesString(String notesString) { + if(!notesString.equals(this.notesString )) { + this.notesString = notesString; + } + } + + public void setTextNotesString(String textNotesString) { + if(!textNotesString.equals(this.textNotesString )) { + this.textNotesString = textNotesString; + } + } + + public void setUpdate() { + this.moveEnds(); + } + // page start from 1 public void setPage(int page) { this.page = page>1?page:1; } public void setScale(float scale) { + if(this.alreadyDraw) { + this.scaleChange = true; + } this.scale = scale; } @@ -297,6 +556,10 @@ public void setHorizontal(boolean horizontal) { this.horizontal = horizontal; } + public void setScrollEnabled(boolean scrollEnabled) { + this.scrollEnabled = scrollEnabled; + } + public void setSpacing(int spacing) { this.spacing = spacing; } @@ -368,12 +631,22 @@ private void handleUri(String uri) { WritableMap event = Arguments.createMap(); event.putString("message", "linkPressed|"+uri); - ReactContext reactContext = (ReactContext)this.getContext(); - reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( - this.getId(), - "topChange", - event - ); + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + +// ReactContext reactContext = (ReactContext)this.getContext(); +// reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( +// this.getId(), +// "topChange", +// event +// ); } /** @@ -420,4 +693,48 @@ public boolean onTouch(View v, MotionEvent event) { } } } -} + + + @Override + public void onPageSwipeChange(int offset) { + WritableMap event = Arguments.createMap(); + if(Math.abs(offset) > 300*getResources().getDisplayMetrics().density) { + if(offset > 0) { + event.putString("message", "prevPage|"); + } + else { + event.putString("message", "nextPage|"); + } + + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + } + } + + + @Override + public void actionEnd() { + SizeF pageSize = getPageSize(0); + float width = pageSize.getWidth(); + float height = pageSize.getHeight(); + + WritableMap event = Arguments.createMap(); + event.putString("message", "actionEnd|"+getZoomScale()+"|"+(this.getCurrentXOffset())+"|"+(this.getCurrentYOffset())+"|"+(this.getPositionOffset())+"|"+width+"|"+height); + ThemedReactContext context = (ThemedReactContext) getContext(); + EventDispatcher dispatcher = UIManagerHelper.getEventDispatcherForReactTag(context, getId()); + int surfaceId = UIManagerHelper.getSurfaceId(this); + + TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event); + + if (dispatcher != null) { + dispatcher.dispatchEvent(tce); + } + } +} \ No newline at end of file diff --git a/android/src/main/java/org/wonday/pdf/RCTPdfManager.java b/android/src/main/java/org/wonday/pdf/RCTPdfManager.java deleted file mode 100644 index eddf1ac7..00000000 --- a/android/src/main/java/org/wonday/pdf/RCTPdfManager.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Copyright (c) 2017-present, Wonday (@wonday.org) - * All rights reserved. - * - * This source code is licensed under the MIT-style license found in the - * LICENSE file in the root directory of this source tree. - */ - -package org.wonday.pdf; - -import java.io.File; - -import android.content.Context; -import android.view.ViewGroup; -import android.util.Log; -import android.graphics.PointF; -import android.net.Uri; - -import com.facebook.react.bridge.NativeModule; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.WritableMap; -import com.facebook.react.uimanager.SimpleViewManager; -import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.react.uimanager.annotations.ReactProp; -import com.facebook.react.uimanager.events.RCTEventEmitter; -import com.facebook.react.common.MapBuilder; -import com.facebook.react.modules.core.DeviceEventManagerModule; - -import static java.lang.String.format; -import java.lang.ClassCastException; - -import com.github.barteksc.pdfviewer.util.FitPolicy; - -public class RCTPdfManager extends SimpleViewManager { - private static final String REACT_CLASS = "RCTPdf"; - private Context context; - private PdfView pdfView; - - - public RCTPdfManager(ReactApplicationContext reactContext){ - this.context = reactContext; - } - - @Override - public String getName() { - return REACT_CLASS; - } - - @Override - public PdfView createViewInstance(ThemedReactContext context) { - this.pdfView = new PdfView(context,null); - return pdfView; - } - - @Override - public void onDropViewInstance(PdfView pdfView) { - pdfView = null; - } - - @ReactProp(name = "path") - public void setPath(PdfView pdfView, String path) { - pdfView.setPath(path); - } - - // page start from 1 - @ReactProp(name = "page") - public void setPage(PdfView pdfView, int page) { - pdfView.setPage(page); - } - - @ReactProp(name = "scale") - public void setScale(PdfView pdfView, float scale) { - pdfView.setScale(scale); - } - - @ReactProp(name = "minScale") - public void setMinScale(PdfView pdfView, float minScale) { - pdfView.setMinScale(minScale); - } - - @ReactProp(name = "maxScale") - public void setMaxScale(PdfView pdfView, float maxScale) { - pdfView.setMaxScale(maxScale); - } - - @ReactProp(name = "horizontal") - public void setHorizontal(PdfView pdfView, boolean horizontal) { - pdfView.setHorizontal(horizontal); - } - - @ReactProp(name = "spacing") - public void setSpacing(PdfView pdfView, int spacing) { - pdfView.setSpacing(spacing); - } - - @ReactProp(name = "password") - public void setPassword(PdfView pdfView, String password) { - pdfView.setPassword(password); - } - - @ReactProp(name = "enableAntialiasing") - public void setEnableAntialiasing(PdfView pdfView, boolean enableAntialiasing) { - pdfView.setEnableAntialiasing(enableAntialiasing); - } - - @ReactProp(name = "enableAnnotationRendering") - public void setEnableAnnotationRendering(PdfView pdfView, boolean enableAnnotationRendering) { - pdfView.setEnableAnnotationRendering(enableAnnotationRendering); - } - - @ReactProp(name = "enablePaging") - public void setEnablePaging(PdfView pdfView, boolean enablePaging) { - pdfView.setEnablePaging(enablePaging); - } - - @ReactProp(name = "fitPolicy") - public void setFitPolycy(PdfView pdfView, int fitPolicy) { - pdfView.setFitPolicy(fitPolicy); - } - - @ReactProp(name = "singlePage") - public void setSinglePage(PdfView pdfView, boolean singlePage) { - pdfView.setSinglePage(singlePage); - } - - @Override - public void onAfterUpdateTransaction(PdfView pdfView) { - super.onAfterUpdateTransaction(pdfView); - pdfView.drawPdf(); - } - -} diff --git a/android/src/main/java/org/wonday/pdf/RCTPdfView.java b/android/src/main/java/org/wonday/pdf/RNPDFPackage.java similarity index 89% rename from android/src/main/java/org/wonday/pdf/RCTPdfView.java rename to android/src/main/java/org/wonday/pdf/RNPDFPackage.java index 5fca80df..01b85660 100644 --- a/android/src/main/java/org/wonday/pdf/RCTPdfView.java +++ b/android/src/main/java/org/wonday/pdf/RNPDFPackage.java @@ -8,7 +8,6 @@ package org.wonday.pdf; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.ArrayList; @@ -19,7 +18,7 @@ import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; -public class RCTPdfView implements ReactPackage { +public class RNPDFPackage implements ReactPackage { @Override public List createNativeModules(ReactApplicationContext reactContext) { @@ -34,7 +33,7 @@ public List> createJSModules() { @Override public List createViewManagers(ReactApplicationContext reactContext) { List modules = new ArrayList<>(); - modules.add(new RCTPdfManager(reactContext)); + modules.add(new PdfManager(reactContext)); return modules; } } diff --git a/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java b/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java new file mode 100644 index 00000000..417b08b0 --- /dev/null +++ b/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java @@ -0,0 +1,26 @@ +package org.wonday.pdf.events; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.WritableMap; +import com.facebook.react.uimanager.events.Event; + +public class TopChangeEvent extends Event { + private WritableMap eventData; + + public TopChangeEvent(int surfaceId, int viewTag, WritableMap data) { + super(surfaceId, viewTag); + eventData = data; + } + + @Override + public String getEventName() { + return "topChange"; + } + + @Nullable + @Override + protected WritableMap getEventData() { + return eventData; + } +} diff --git a/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java b/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java new file mode 100644 index 00000000..43848d9c --- /dev/null +++ b/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java @@ -0,0 +1,92 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; +import androidx.annotation.Nullable; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class RNPDFPdfViewManagerDelegate & RNPDFPdfViewManagerInterface> extends BaseViewManagerDelegate { + public RNPDFPdfViewManagerDelegate(U viewManager) { + super(viewManager); + } + + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "path": + mViewManager.setPath(view, value == null ? null : (String) value); + break; + case "page": + mViewManager.setPage(view, value == null ? 0 : ((Double) value).intValue()); + break; + case "scale": + mViewManager.setScale(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "minScale": + mViewManager.setMinScale(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "maxScale": + mViewManager.setMaxScale(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "horizontal": + mViewManager.setHorizontal(view, value == null ? false : (boolean) value); + break; + case "showsHorizontalScrollIndicator": + mViewManager.setShowsHorizontalScrollIndicator(view, value == null ? false : (boolean) value); + break; + case "showsVerticalScrollIndicator": + mViewManager.setShowsVerticalScrollIndicator(view, value == null ? false : (boolean) value); + break; + case "scrollEnabled": + mViewManager.setScrollEnabled(view, value == null ? false : (boolean) value); + break; + case "enablePaging": + mViewManager.setEnablePaging(view, value == null ? false : (boolean) value); + break; + case "enableRTL": + mViewManager.setEnableRTL(view, value == null ? false : (boolean) value); + break; + case "enableAnnotationRendering": + mViewManager.setEnableAnnotationRendering(view, value == null ? false : (boolean) value); + break; + case "enableDoubleTapZoom": + mViewManager.setEnableDoubleTapZoom(view, value == null ? false : (boolean) value); + break; + case "enableAntialiasing": + mViewManager.setEnableAntialiasing(view, value == null ? false : (boolean) value); + break; + case "fitPolicy": + mViewManager.setFitPolicy(view, value == null ? 0 : ((Double) value).intValue()); + break; + case "spacing": + mViewManager.setSpacing(view, value == null ? 0 : ((Double) value).intValue()); + break; + case "password": + mViewManager.setPassword(view, value == null ? null : (String) value); + break; + case "singlePage": + mViewManager.setSinglePage(view, value == null ? false : (boolean) value); + break; + default: + super.setProperty(view, propName, value); + } + } + + public void receiveCommand(T view, String commandName, ReadableArray args) { + switch (commandName) { + case "setNativePage": + mViewManager.setNativePage(view, args.getInt(0)); + break; + } + } +} diff --git a/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java b/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java new file mode 100644 index 00000000..397268f0 --- /dev/null +++ b/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerInterface.java @@ -0,0 +1,35 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; +import androidx.annotation.Nullable; + +public interface RNPDFPdfViewManagerInterface { + void setPath(T view, @Nullable String value); + void setPage(T view, int value); + void setScale(T view, float value); + void setMinScale(T view, float value); + void setMaxScale(T view, float value); + void setHorizontal(T view, boolean value); + void setShowsHorizontalScrollIndicator(T view, boolean value); + void setShowsVerticalScrollIndicator(T view, boolean value); + void setScrollEnabled(T view, boolean value); + void setEnablePaging(T view, boolean value); + void setEnableRTL(T view, boolean value); + void setEnableAnnotationRendering(T view, boolean value); + void setEnableDoubleTapZoom(T view, boolean value); + void setEnableAntialiasing(T view, boolean value); + void setFitPolicy(T view, int value); + void setSpacing(T view, int value); + void setPassword(T view, @Nullable String value); + void setSinglePage(T view, boolean value); + void setNativePage(T view, int page); +} diff --git a/example/.eslintrc.js b/example/.eslintrc.js deleted file mode 100644 index 40c6dcd0..00000000 --- a/example/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: '@react-native-community', -}; diff --git a/example/.gitignore b/example/.gitignore deleted file mode 100644 index f3bcfdf4..00000000 --- a/example/.gitignore +++ /dev/null @@ -1,123 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# BUCK -buck-out/ -\.buckd/ -*.keystore - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots - -# Bundle artifact -*.jsbundle - -# CocoaPods -/ios/Pods/ - -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots - -# Bundle artifact -*.jsbundle - -# CocoaPods -/ios/Pods/ - -# VS -*.binlog -*.ProjectImports.zip diff --git a/example/PDFExample.js b/example/PDFExample.js deleted file mode 100644 index d9a70b84..00000000 --- a/example/PDFExample.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Copyright (c) 2017-present, Wonday (@wonday.org) - * All rights reserved. - * - * This source code is licensed under the MIT-style license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React from 'react'; -import { - StyleSheet, - TouchableHighlight, - Dimensions, - SafeAreaView, - View, - Text, - Platform -} from 'react-native'; - -import Pdf from 'react-native-pdf'; -import Orientation from 'react-native-orientation-locker'; - -const WIN_WIDTH = Dimensions.get('window').width; -const WIN_HEIGHT = Dimensions.get('window').height; - - -export default class PDFExample extends React.Component { - constructor(props) { - super(props); - this.state = { - page: 1, - scale: 1, - numberOfPages: 0, - horizontal: false, - width: WIN_WIDTH - }; - this.pdf = null; - } - - _onOrientationDidChange = (orientation) => { - if (orientation == 'LANDSCAPE-LEFT'||orientation == 'LANDSCAPE-RIGHT') { - this.setState({width:WIN_HEIGHT>WIN_WIDTH?WIN_HEIGHT:WIN_WIDTH,horizontal:true}); - } else { - this.setState({width:WIN_HEIGHT>WIN_WIDTH?WIN_HEIGHT:WIN_WIDTH,horizontal:false}); - } - }; - - componentDidMount() { - Orientation.addOrientationListener(this._onOrientationDidChange); - - (async () => { - const url = 'http://samples.leanpub.com/thereactnativebook-sample.pdf'; - // handling blobs larger than 64 KB on Android requires patching React Native (https://github.com/facebook/react-native/pull/31789) - const result = await fetch(url); - const blob = await result.blob(); - const objectURL = URL.createObjectURL(blob); - this.setState({...this.state, objectURL, blob}); // keep blob in state so it doesn't get garbage-collected - })(); - } - - componentWillUnmount() { - Orientation.removeOrientationListener(this._onOrientationDidChange); - } - - prePage = () => { - let prePage = this.state.page > 1 ? this.state.page - 1 : 1; - this.pdf.setPage(prePage); - console.log(`prePage: ${prePage}`); - }; - - nextPage = () => { - let nextPage = this.state.page + 1 > this.state.numberOfPages ? this.state.numberOfPages : this.state.page + 1; - this.pdf.setPage(nextPage); - console.log(`nextPage: ${nextPage}`); - }; - - zoomOut = () => { - let scale = this.state.scale > 1 ? this.state.scale / 1.2 : 1; - this.setState({scale: scale}); - console.log(`zoomOut scale: ${scale}`); - }; - - zoomIn = () => { - let scale = this.state.scale * 1.2; - scale = scale > 3 ? 3 : scale; - this.setState({scale: scale}); - console.log(`zoomIn scale: ${scale}`); - }; - - switchHorizontal = () => { - this.setState({horizontal: !this.state.horizontal, page: this.state.page}); - }; - - render() { - let source = Platform.OS === 'windows' ? {uri: 'ms-appx:///test.pdf'} : {uri:'http://samples.leanpub.com/thereactnativebook-sample.pdf',cache:true}; - //let source = {uri:'http://samples.leanpub.com/thereactnativebook-sample.pdf',cache:true}; - //let source = {uri: 'ms-appx:///test.pdf'} - //let source = require('./test.pdf'); // ios only - //let source = {uri:'bundle-assets://test.pdf'}; - //let source = {uri: this.state.objectURL}; - - //let source = {uri:'file:///sdcard/test.pdf'}; - //let source = {uri:"data:application/pdf;base64,JVBERi0xLjcKJcKzx9gNCjEgMCBvYmoNPDwvTmFtZXMgPDwvRGVzdHMgNCAwIFI+PiAvT3V0bGluZXMgNSAwIFIgL1BhZ2VzIDIgMCBSIC9UeXBlIC9DYXRhbG9nPj4NZW5kb2JqDTMgMCBvYmoNPDwvQXV0aG9yIChXb25kYXkpIC9Db21tZW50cyAoKSAvQ29tcGFueSAoKSAvQ3JlYXRpb25EYXRlIChEOjIwMTcwNDIzMjE1OTA5KzEzJzU5JykgL0NyZWF0b3IgKFdQUyBPZmZpY2UpIC9LZXl3b3JkcyAoKSAvTW9kRGF0ZSAoRDoyMDE3MDQyMzIxNTkwOSsxMyc1OScpIC9Qcm9kdWNlciAoKSAvU291cmNlTW9kaWZpZWQgKEQ6MjAxNzA0MjMyMTU5MDkrMTMnNTknKSAvU3ViamVjdCAoKSAvVGl0bGUgKCkgL1RyYXBwZWQgZmFsc2U+Pg1lbmRvYmoNNiA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( - - - this.prePage()}> - {'-'} - - Page - this.nextPage()}> - {'+'} - - this.zoomOut()}> - {'-'} - - Scale - = 3} - style={this.state.scale >= 3 ? styles.btnDisable : styles.btn} - onPress={() => this.zoomIn()}> - {'+'} - - {'Horizontal:'} - this.switchHorizontal()}> - {!this.state.horizontal ? ({'false'}) : ( - {'true'})} - - - - - { - this.pdf = pdf; - }} - source={source} - scale={this.state.scale} - horizontal={this.state.horizontal} - onLoadComplete={(numberOfPages, filePath,{width,height},tableContents) => { - this.setState({ - numberOfPages: numberOfPages - }); - console.log(`total page count: ${numberOfPages}`); - console.log(tableContents); - }} - onPageChanged={(page, numberOfPages) => { - this.setState({ - page: page - }); - console.log(`current page: ${page}`); - }} - onError={(error) => { - console.log(error); - }} - style={{flex:1}} - /> - - - ) - } -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'flex-start', - alignItems: 'center', - marginTop: 25, - }, - btn: { - margin: 2, - padding: 2, - backgroundColor: "aqua", - }, - btnDisable: { - margin: 2, - padding: 2, - backgroundColor: "gray", - }, - btnText: { - margin: 2, - padding: 2, - } -}); diff --git a/example/__windows_tests__/TestPDF.js b/example/__windows_tests__/TestPDF.js deleted file mode 100644 index 7234ce22..00000000 --- a/example/__windows_tests__/TestPDF.js +++ /dev/null @@ -1,43 +0,0 @@ -import { driver, By2 } from 'selenium-appium' -import { PNG } from 'pngjs'; -import pixelmatch from 'pixelmatch'; - - -const setup = require('../jest-windows/driver.setup'); -jest.setTimeout(50000); - -beforeAll(() => { - return driver.startWithCapabilities(setup.capabilites); -}); - -afterAll(() => { - return driver.quit(); -}); - -function pngFromBase64(base64) { - const pngBuffer = Buffer.from(base64, 'base64'); - return PNG.sync.read(pngBuffer); -}; - -const pixelThreshold = 10; // Allow 10 pixel difference, to account for anti-aliasing differences. - -function pixelDiffPNGs(img1, img2) { - return pixelmatch(img1.data, img2.data, null, img1.width, img1.height); -} - -describe('Test App', () => { - - test('App loads PDF', async () => { - await By2.nativeName("PDF Page 21"); - }); - - test('Switch to next page', async () => { - // wait for PDF load - await By2.nativeName('PDF Page 21'); - let beforeNextPage = pngFromBase64(await driver.takeScreenshot()); - await By2.nativeAccessibilityId('NextPage').click(); - let aferNextPage = pngFromBase64(await driver.takeScreenshot()); - expect(pixelDiffPNGs(beforeNextPage, aferNextPage)).toBeGreaterThanOrEqual(pixelThreshold); - }) - -}) diff --git a/example/android/app/BUCK b/example/android/app/BUCK deleted file mode 100644 index e9342850..00000000 --- a/example/android/app/BUCK +++ /dev/null @@ -1,55 +0,0 @@ -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") - -lib_deps = [] - -create_aar_targets(glob(["libs/*.aar"])) - -create_jar_targets(glob(["libs/*.jar"])) - -android_library( - name = "all-libs", - exported_deps = lib_deps, -) - -android_library( - name = "app-code", - srcs = glob([ - "src/main/java/**/*.java", - ]), - deps = [ - ":all-libs", - ":build_config", - ":res", - ], -) - -android_build_config( - name = "build_config", - package = "com.pdfexample", -) - -android_resource( - name = "res", - package = "com.pdfexample", - res = "src/main/res", -) - -android_binary( - name = "app", - keystore = "//android/keystores:debug", - manifest = "src/main/AndroidManifest.xml", - package_type = "debug", - deps = [ - ":app-code", - ], -) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index 2f6b78a9..00000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,210 +0,0 @@ -apply plugin: "com.android.application" - -import com.android.build.OutputFile - -/** - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets - * and bundleReleaseJsAndAssets). - * These basically call `react-native bundle` with the correct arguments during the Android build - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the - * bundle directly from the development server. Below you can see all the possible configurations - * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "../../node_modules/react-native/react.gradle"` line. - * - * project.ext.react = [ - * // the name of the generated asset file containing your JS bundle - * bundleAssetName: "index.android.bundle", - * - * // the entry file for bundle generation - * entryFile: "index.android.js", - * - * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format - * bundleCommand: "ram-bundle", - * - * // whether to bundle JS and assets in debug mode - * bundleInDebug: false, - * - * // whether to bundle JS and assets in release mode - * bundleInRelease: true, - * - * // whether to bundle JS and assets in another build variant (if configured). - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property can be in the following formats - * // 'bundleIn${productFlavor}${buildType}' - * // 'bundleIn${buildType}' - * // bundleInFreeDebug: true, - * // bundleInPaidRelease: true, - * // bundleInBeta: true, - * - * // whether to disable dev mode in custom build variants (by default only disabled in release) - * // for example: to disable dev mode in the staging build type (if configured) - * devDisabledInStaging: true, - * // The configuration property can be in the following formats - * // 'devDisabledIn${productFlavor}${buildType}' - * // 'devDisabledIn${buildType}' - * - * // the root of your project, i.e. where "package.json" lives - * root: "../../", - * - * // where to put the JS bundle asset in debug mode - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", - * - * // where to put the JS bundle asset in release mode - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in debug mode - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in release mode - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", - * - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to - * // date; if you have any other folders that you want to ignore for performance reasons (gradle - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ - * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"], - * - * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"], - * - * // supply additional arguments to the packager - * extraPackagerArgs: [] - * ] - */ - -project.ext.react = [ - entryFile: "index.js", - enableHermes: false, // clean and rebuild if changing -] - -apply from: "../../node_modules/react-native/react.gradle" - -/** - * Set this to true to create two separate APKs instead of one: - * - An APK that only works on ARM devices - * - An APK that only works on x86 devices - * The advantage is the size of the APK is reduced by about 4MB. - * Upload all the APKs to the Play Store and people will download - * the correct one based on the CPU architecture of their device. - */ -def enableSeparateBuildPerCPUArchitecture = false - -/** - * Run Proguard to shrink the Java bytecode in release builds. - */ -def enableProguardInReleaseBuilds = false - -/** - * The preferred build flavor of JavaScriptCore. - * - * For example, to use the international variant, you can use: - * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` - * - * The international variant includes ICU i18n library and necessary data - * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that - * give correct results when using with locales other than en-US. Note that - * this variant is about 6MiB larger per architecture than default. - */ -def jscFlavor = 'org.webkit:android-jsc:+' - -/** - * Whether to enable the Hermes VM. - * - * This should be set on project.ext.react and mirrored here. If it is not set - * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode - * and the benefits of using Hermes will therefore be sharply reduced. - */ -def enableHermes = project.ext.react.get("enableHermes", false); - -android { - compileSdkVersion rootProject.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - applicationId "com.pdfexample" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" - } - splits { - abi { - reset() - enable enableSeparateBuildPerCPUArchitecture - universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" - } - } - signingConfigs { - debug { - storeFile file('debug.keystore') - storePassword 'android' - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - buildTypes { - debug { - signingConfig signingConfigs.debug - } - release { - // Caution! In production, you need to generate your own keystore file. - // see https://facebook.github.io/react-native/docs/signed-apk-android. - signingConfig signingConfigs.debug - minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // https://developer.android.com/studio/build/configure-apk-splits.html - def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode - } - - } - } - - packagingOptions { - pickFirst '**/armeabi-v7a/libc++_shared.so' - pickFirst '**/x86/libc++_shared.so' - pickFirst '**/arm64-v8a/libc++_shared.so' - pickFirst '**/x86_64/libc++_shared.so' - pickFirst '**/x86/libjsc.so' - pickFirst '**/armeabi-v7a/libjsc.so' - } -} - -dependencies { - implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation "com.facebook.react:react-native:+" // From node_modules - - if (enableHermes) { - def hermesPath = "../../node_modules/hermesvm/android/"; - debugImplementation files(hermesPath + "hermes-debug.aar") - releaseImplementation files(hermesPath + "hermes-release.aar") - } else { - implementation jscFlavor - } -} - -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile - into 'libs' -} - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/example/android/app/build_defs.bzl b/example/android/app/build_defs.bzl deleted file mode 100644 index fff270f8..00000000 --- a/example/android/app/build_defs.bzl +++ /dev/null @@ -1,19 +0,0 @@ -"""Helper definitions to glob .aar and .jar targets""" - -def create_aar_targets(aarfiles): - for aarfile in aarfiles: - name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] - lib_deps.append(":" + name) - android_prebuilt_aar( - name = name, - aar = aarfile, - ) - -def create_jar_targets(jarfiles): - for jarfile in jarfiles: - name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] - lib_deps.append(":" + name) - prebuilt_jar( - name = name, - binary_jar = jarfile, - ) diff --git a/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro deleted file mode 100644 index 11b02572..00000000 --- a/example/android/app/proguard-rules.pro +++ /dev/null @@ -1,10 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index fa26aa56..00000000 --- a/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 807fc0fe..00000000 --- a/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/example/android/app/src/main/assets/test.pdf b/example/android/app/src/main/assets/test.pdf deleted file mode 100644 index 9118d2b1..00000000 Binary files a/example/android/app/src/main/assets/test.pdf and /dev/null differ diff --git a/example/android/app/src/main/java/com/pdfexample/MainActivity.java b/example/android/app/src/main/java/com/pdfexample/MainActivity.java deleted file mode 100644 index 36cca63f..00000000 --- a/example/android/app/src/main/java/com/pdfexample/MainActivity.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.pdfexample; - -import com.facebook.react.ReactActivity; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. - * This is used to schedule rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "PDFExample"; - } -} diff --git a/example/android/app/src/main/java/com/pdfexample/MainApplication.java b/example/android/app/src/main/java/com/pdfexample/MainApplication.java deleted file mode 100644 index 3d44af35..00000000 --- a/example/android/app/src/main/java/com/pdfexample/MainApplication.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.pdfexample; - -import android.app.Application; -import android.util.Log; - -import com.facebook.react.PackageList; -import com.facebook.hermes.reactexecutor.HermesExecutorFactory; -import com.facebook.react.bridge.JavaScriptExecutorFactory; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.soloader.SoLoader; - -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - } -} diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index a2f59082..00000000 Binary files a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index 1b523998..00000000 Binary files a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index ff10afd6..00000000 Binary files a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 115a4c76..00000000 Binary files a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index dcd3cd80..00000000 Binary files a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 459ca609..00000000 Binary files a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 8ca12fe0..00000000 Binary files a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 8e19b410..00000000 Binary files a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index b824ebdd..00000000 Binary files a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 4c19a13c..00000000 Binary files a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/example/android/app/src/main/res/values/strings.xml b/example/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 5eb76087..00000000 --- a/example/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - PDFExample - com.pdfexample.blobs - diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 62fe59fa..00000000 --- a/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index 52e12034..00000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext { - buildToolsVersion = "28.0.3" - minSdkVersion = 16 - compileSdkVersion = 28 - targetSdkVersion = 28 - supportLibVersion = "28.0.0" - } - repositories { - google() - mavenCentral() - } - dependencies { - classpath("com.android.tools.build:gradle:3.4.1") - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url("$rootDir/../node_modules/react-native/android") - } - maven { - // Android JSC is installed from npm - url("$rootDir/../node_modules/jsc-android/dist") - } - - google() - mavenCentral() - } -} diff --git a/example/android/gradle.properties b/example/android/gradle.properties deleted file mode 100644 index 027ef9db..00000000 --- a/example/android/gradle.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -android.useAndroidX=true -android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/example/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 5c2d1cf0..00000000 Binary files a/example/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/example/android/gradlew b/example/android/gradlew deleted file mode 100755 index b0d6d0ab..00000000 --- a/example/android/gradlew +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 719b1f1f..00000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = 'PDFExample' -apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) -include ':app' diff --git a/example/app.json b/example/app.json deleted file mode 100644 index fc421412..00000000 --- a/example/app.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "PDFExample", - "displayName": "PDFExample" -} \ No newline at end of file diff --git a/example/babel.config.js b/example/babel.config.js deleted file mode 100644 index f842b77f..00000000 --- a/example/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: ['module:metro-react-native-babel-preset'], -}; diff --git a/example/index.js b/example/index.js deleted file mode 100644 index 83b9bb7a..00000000 --- a/example/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @format - */ - -import {AppRegistry} from 'react-native'; -import PDFExample from './PDFExample'; -import {name as appName} from './app.json'; - -AppRegistry.registerComponent(appName, () => PDFExample); diff --git a/example/ios/PDFExample-tvOS/Info.plist b/example/ios/PDFExample-tvOS/Info.plist deleted file mode 100644 index ecbd496b..00000000 --- a/example/ios/PDFExample-tvOS/Info.plist +++ /dev/null @@ -1,53 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - - - NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/example/ios/PDFExample-tvOSTests/Info.plist b/example/ios/PDFExample-tvOSTests/Info.plist deleted file mode 100644 index 886825cc..00000000 --- a/example/ios/PDFExample-tvOSTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/example/ios/PDFExample.xcodeproj/project.pbxproj b/example/ios/PDFExample.xcodeproj/project.pbxproj deleted file mode 100644 index ffb924c8..00000000 --- a/example/ios/PDFExample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,923 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* PDFExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* PDFExampleTests.m */; }; - 014171ED02D6EA0A0A64971A /* libPods-PDFExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 098A45430F7176D348A6DC88 /* libPods-PDFExampleTests.a */; }; - 04F0D6625996957223F98A19 /* libPods-PDFExample-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE1E13F1C46F2FE0018918EC /* libPods-PDFExample-tvOSTests.a */; }; - 06D78736C17B978FECC236B3 /* libPods-PDFExample-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E8D3411FCA1D5A9BF03B714 /* libPods-PDFExample-tvOS.a */; }; - 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 27A778B723EA56E6AA32A7F5 /* libPods-PDFExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 88FD9DA8FB4BE0D551254B86 /* libPods-PDFExample.a */; }; - 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 2DCD954D1E0B4F2C00145EB5 /* PDFExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* PDFExampleTests.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = PDFExample; - }; - 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; - remoteInfo = "PDFExample-tvOS"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; - 00E356EE1AD99517003FC87E /* PDFExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PDFExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* PDFExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFExampleTests.m; sourceTree = ""; }; - 098A45430F7176D348A6DC88 /* libPods-PDFExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PDFExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07F961A680F5B00A75B9A /* PDFExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PDFExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = PDFExample/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = PDFExample/AppDelegate.m; sourceTree = ""; }; - 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PDFExample/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PDFExample/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PDFExample/main.m; sourceTree = ""; }; - 1804E2A6EFC6811EBBD39CA6 /* Pods-PDFExample-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExample-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-PDFExample-tvOS/Pods-PDFExample-tvOS.debug.xcconfig"; sourceTree = ""; }; - 290D274B0DBE7166308E91C8 /* Pods-PDFExample-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExample-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-PDFExample-tvOSTests/Pods-PDFExample-tvOSTests.release.xcconfig"; sourceTree = ""; }; - 2B742635006D932699F6A876 /* Pods-PDFExample-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExample-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-PDFExample-tvOSTests/Pods-PDFExample-tvOSTests.debug.xcconfig"; sourceTree = ""; }; - 2D02E47B1E0B4A5D006451C7 /* PDFExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PDFExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2D02E4901E0B4A5D006451C7 /* PDFExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PDFExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4E8D3411FCA1D5A9BF03B714 /* libPods-PDFExample-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PDFExample-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 57A132A19E20689C43CF0330 /* Pods-PDFExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-PDFExampleTests/Pods-PDFExampleTests.debug.xcconfig"; sourceTree = ""; }; - 7FC92BE2205BD7FF6B5F4022 /* Pods-PDFExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExample.release.xcconfig"; path = "Target Support Files/Pods-PDFExample/Pods-PDFExample.release.xcconfig"; sourceTree = ""; }; - 88FD9DA8FB4BE0D551254B86 /* libPods-PDFExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PDFExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - CE1E13F1C46F2FE0018918EC /* libPods-PDFExample-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PDFExample-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - D81A5360685BEAA6B61D9FC3 /* Pods-PDFExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExample.debug.xcconfig"; path = "Target Support Files/Pods-PDFExample/Pods-PDFExample.debug.xcconfig"; sourceTree = ""; }; - E522718F147CC33F679DD07C /* Pods-PDFExample-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExample-tvOS.release.xcconfig"; path = "Target Support Files/Pods-PDFExample-tvOS/Pods-PDFExample-tvOS.release.xcconfig"; sourceTree = ""; }; - ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; - EFAEE976EB60AD504D1D0E83 /* Pods-PDFExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PDFExampleTests.release.xcconfig"; path = "Target Support Files/Pods-PDFExampleTests/Pods-PDFExampleTests.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 014171ED02D6EA0A0A64971A /* libPods-PDFExampleTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 27A778B723EA56E6AA32A7F5 /* libPods-PDFExample.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 06D78736C17B978FECC236B3 /* libPods-PDFExample-tvOS.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 04F0D6625996957223F98A19 /* libPods-PDFExample-tvOSTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 00E356EF1AD99517003FC87E /* PDFExampleTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* PDFExampleTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = PDFExampleTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 13B07FAE1A68108700A75B9A /* PDFExample */ = { - isa = PBXGroup; - children = ( - 008F07F21AC5B25A0029DE68 /* main.jsbundle */, - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.m */, - 13B07FB51A68108700A75B9A /* Images.xcassets */, - 13B07FB61A68108700A75B9A /* Info.plist */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, - 13B07FB71A68108700A75B9A /* main.m */, - ); - name = PDFExample; - sourceTree = ""; - }; - 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { - isa = PBXGroup; - children = ( - ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - ED2971642150620600B7C4FE /* JavaScriptCore.framework */, - 88FD9DA8FB4BE0D551254B86 /* libPods-PDFExample.a */, - 4E8D3411FCA1D5A9BF03B714 /* libPods-PDFExample-tvOS.a */, - CE1E13F1C46F2FE0018918EC /* libPods-PDFExample-tvOSTests.a */, - 098A45430F7176D348A6DC88 /* libPods-PDFExampleTests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = Libraries; - sourceTree = ""; - }; - 83CBB9F61A601CBA00E9B192 = { - isa = PBXGroup; - children = ( - 13B07FAE1A68108700A75B9A /* PDFExample */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* PDFExampleTests */, - 83CBBA001A601CBA00E9B192 /* Products */, - 2D16E6871FA4F8E400B85C8A /* Frameworks */, - FFD3DBE20FE7A8253F5C0808 /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 83CBBA001A601CBA00E9B192 /* Products */ = { - isa = PBXGroup; - children = ( - 13B07F961A680F5B00A75B9A /* PDFExample.app */, - 00E356EE1AD99517003FC87E /* PDFExampleTests.xctest */, - 2D02E47B1E0B4A5D006451C7 /* PDFExample-tvOS.app */, - 2D02E4901E0B4A5D006451C7 /* PDFExample-tvOSTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - FFD3DBE20FE7A8253F5C0808 /* Pods */ = { - isa = PBXGroup; - children = ( - D81A5360685BEAA6B61D9FC3 /* Pods-PDFExample.debug.xcconfig */, - 7FC92BE2205BD7FF6B5F4022 /* Pods-PDFExample.release.xcconfig */, - 1804E2A6EFC6811EBBD39CA6 /* Pods-PDFExample-tvOS.debug.xcconfig */, - E522718F147CC33F679DD07C /* Pods-PDFExample-tvOS.release.xcconfig */, - 2B742635006D932699F6A876 /* Pods-PDFExample-tvOSTests.debug.xcconfig */, - 290D274B0DBE7166308E91C8 /* Pods-PDFExample-tvOSTests.release.xcconfig */, - 57A132A19E20689C43CF0330 /* Pods-PDFExampleTests.debug.xcconfig */, - EFAEE976EB60AD504D1D0E83 /* Pods-PDFExampleTests.release.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* PDFExampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "PDFExampleTests" */; - buildPhases = ( - 342563465147C984FD1E33E4 /* [CP] Check Pods Manifest.lock */, - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = PDFExampleTests; - productName = PDFExampleTests; - productReference = 00E356EE1AD99517003FC87E /* PDFExampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 13B07F861A680F5B00A75B9A /* PDFExample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PDFExample" */; - buildPhases = ( - 4F618DA08757E7063652AAB1 /* [CP] Check Pods Manifest.lock */, - FD10A7F022414F080027D42C /* Start Packager */, - 13B07F871A680F5B00A75B9A /* Sources */, - 13B07F8C1A680F5B00A75B9A /* Frameworks */, - 13B07F8E1A680F5B00A75B9A /* Resources */, - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PDFExample; - productName = PDFExample; - productReference = 13B07F961A680F5B00A75B9A /* PDFExample.app */; - productType = "com.apple.product-type.application"; - }; - 2D02E47A1E0B4A5D006451C7 /* PDFExample-tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PDFExample-tvOS" */; - buildPhases = ( - 999FD2DB1B5086ABD8BB3A43 /* [CP] Check Pods Manifest.lock */, - FD10A7F122414F3F0027D42C /* Start Packager */, - 2D02E4771E0B4A5D006451C7 /* Sources */, - 2D02E4781E0B4A5D006451C7 /* Frameworks */, - 2D02E4791E0B4A5D006451C7 /* Resources */, - 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "PDFExample-tvOS"; - productName = "PDFExample-tvOS"; - productReference = 2D02E47B1E0B4A5D006451C7 /* PDFExample-tvOS.app */; - productType = "com.apple.product-type.application"; - }; - 2D02E48F1E0B4A5D006451C7 /* PDFExample-tvOSTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PDFExample-tvOSTests" */; - buildPhases = ( - D03B24DB332E22E03B304D29 /* [CP] Check Pods Manifest.lock */, - 2D02E48C1E0B4A5D006451C7 /* Sources */, - 2D02E48D1E0B4A5D006451C7 /* Frameworks */, - 2D02E48E1E0B4A5D006451C7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, - ); - name = "PDFExample-tvOSTests"; - productName = "PDFExample-tvOSTests"; - productReference = 2D02E4901E0B4A5D006451C7 /* PDFExample-tvOSTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 83CBB9F71A601CBA00E9B192 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0940; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; - 2D02E47A1E0B4A5D006451C7 = { - CreatedOnToolsVersion = 8.2.1; - ProvisioningStyle = Automatic; - }; - 2D02E48F1E0B4A5D006451C7 = { - CreatedOnToolsVersion = 8.2.1; - ProvisioningStyle = Automatic; - TestTargetID = 2D02E47A1E0B4A5D006451C7; - }; - }; - }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PDFExample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 83CBB9F61A601CBA00E9B192; - productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 13B07F861A680F5B00A75B9A /* PDFExample */, - 00E356ED1AD99517003FC87E /* PDFExampleTests */, - 2D02E47A1E0B4A5D006451C7 /* PDFExample-tvOS */, - 2D02E48F1E0B4A5D006451C7 /* PDFExample-tvOSTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F8E1A680F5B00A75B9A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E4791E0B4A5D006451C7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E48E1E0B4A5D006451C7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Bundle React Native code and images"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; - }; - 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Bundle React Native Code And Images"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; - }; - 342563465147C984FD1E33E4 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PDFExampleTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 4F618DA08757E7063652AAB1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PDFExample-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 999FD2DB1B5086ABD8BB3A43 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PDFExample-tvOS-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - D03B24DB332E22E03B304D29 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PDFExample-tvOSTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - FD10A7F022414F080027D42C /* Start Packager */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Start Packager"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; - showEnvVarsInLog = 0; - }; - FD10A7F122414F3F0027D42C /* Start Packager */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Start Packager"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* PDFExampleTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F871A680F5B00A75B9A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E4771E0B4A5D006451C7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, - 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E48C1E0B4A5D006451C7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2DCD954D1E0B4F2C00145EB5 /* PDFExampleTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* PDFExample */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; - 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 2D02E47A1E0B4A5D006451C7 /* PDFExample-tvOS */; - targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 13B07FB21A68108700A75B9A /* Base */, - ); - name = LaunchScreen.xib; - path = PDFExample; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 57A132A19E20689C43CF0330 /* Pods-PDFExampleTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = PDFExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PDFExample.app/PDFExample"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EFAEE976EB60AD504D1D0E83 /* Pods-PDFExampleTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = PDFExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PDFExample.app/PDFExample"; - }; - name = Release; - }; - 13B07F941A680F5B00A75B9A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D81A5360685BEAA6B61D9FC3 /* Pods-PDFExample.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 1; - DEAD_CODE_STRIPPING = NO; - INFOPLIST_FILE = PDFExample/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = PDFExample; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 13B07F951A680F5B00A75B9A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7FC92BE2205BD7FF6B5F4022 /* Pods-PDFExample.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 1; - INFOPLIST_FILE = PDFExample/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = PDFExample; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - 2D02E4971E0B4A5E006451C7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1804E2A6EFC6811EBBD39CA6 /* Pods-PDFExample-tvOS.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "PDFExample-tvOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PDFExample-tvOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; - name = Debug; - }; - 2D02E4981E0B4A5E006451C7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E522718F147CC33F679DD07C /* Pods-PDFExample-tvOS.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "PDFExample-tvOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PDFExample-tvOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; - name = Release; - }; - 2D02E4991E0B4A5E006451C7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2B742635006D932699F6A876 /* Pods-PDFExample-tvOSTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "PDFExample-tvOSTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PDFExample-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PDFExample-tvOS.app/PDFExample-tvOS"; - TVOS_DEPLOYMENT_TARGET = 10.1; - }; - name = Debug; - }; - 2D02E49A1E0B4A5E006451C7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 290D274B0DBE7166308E91C8 /* Pods-PDFExample-tvOSTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "PDFExample-tvOSTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PDFExample-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PDFExample-tvOS.app/PDFExample-tvOS"; - TVOS_DEPLOYMENT_TARGET = 10.1; - }; - name = Release; - }; - 83CBBA201A601CBA00E9B192 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 83CBBA211A601CBA00E9B192 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "PDFExampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PDFExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 13B07F941A680F5B00A75B9A /* Debug */, - 13B07F951A680F5B00A75B9A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PDFExample-tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2D02E4971E0B4A5E006451C7 /* Debug */, - 2D02E4981E0B4A5E006451C7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PDFExample-tvOSTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2D02E4991E0B4A5E006451C7 /* Debug */, - 2D02E49A1E0B4A5E006451C7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PDFExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 83CBBA201A601CBA00E9B192 /* Debug */, - 83CBBA211A601CBA00E9B192 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; -} diff --git a/example/ios/PDFExample.xcodeproj/xcshareddata/xcschemes/PDFExample-tvOS.xcscheme b/example/ios/PDFExample.xcodeproj/xcshareddata/xcschemes/PDFExample-tvOS.xcscheme deleted file mode 100644 index 73ee0feb..00000000 --- a/example/ios/PDFExample.xcodeproj/xcshareddata/xcschemes/PDFExample-tvOS.xcscheme +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/PDFExample.xcodeproj/xcshareddata/xcschemes/PDFExample.xcscheme b/example/ios/PDFExample.xcodeproj/xcshareddata/xcschemes/PDFExample.xcscheme deleted file mode 100644 index 9914d935..00000000 --- a/example/ios/PDFExample.xcodeproj/xcshareddata/xcschemes/PDFExample.xcscheme +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/PDFExample.xcworkspace/contents.xcworkspacedata b/example/ios/PDFExample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index c17b7baa..00000000 --- a/example/ios/PDFExample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/example/ios/PDFExample/AppDelegate.h b/example/ios/PDFExample/AppDelegate.h deleted file mode 100644 index 2726d5e1..00000000 --- a/example/ios/PDFExample/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import -#import - -@interface AppDelegate : UIResponder - -@property (nonatomic, strong) UIWindow *window; - -@end diff --git a/example/ios/PDFExample/AppDelegate.m b/example/ios/PDFExample/AppDelegate.m deleted file mode 100644 index e304d803..00000000 --- a/example/ios/PDFExample/AppDelegate.m +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "AppDelegate.h" - -#import -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge - moduleName:@"PDFExample" - initialProperties:nil]; - - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/example/ios/PDFExample/Base.lproj/LaunchScreen.xib b/example/ios/PDFExample/Base.lproj/LaunchScreen.xib deleted file mode 100644 index cc9ea13b..00000000 --- a/example/ios/PDFExample/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/PDFExample/Images.xcassets/AppIcon.appiconset/Contents.json b/example/ios/PDFExample/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f7..00000000 --- a/example/ios/PDFExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/example/ios/PDFExample/Images.xcassets/Contents.json b/example/ios/PDFExample/Images.xcassets/Contents.json deleted file mode 100644 index 2d92bd53..00000000 --- a/example/ios/PDFExample/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/example/ios/PDFExample/Info.plist b/example/ios/PDFExample/Info.plist deleted file mode 100644 index c61be3e8..00000000 --- a/example/ios/PDFExample/Info.plist +++ /dev/null @@ -1,57 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - PDFExample - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - - - NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/example/ios/PDFExample/main.m b/example/ios/PDFExample/main.m deleted file mode 100644 index c316cf81..00000000 --- a/example/ios/PDFExample/main.m +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/example/ios/PDFExampleTests/Info.plist b/example/ios/PDFExampleTests/Info.plist deleted file mode 100644 index ba72822e..00000000 --- a/example/ios/PDFExampleTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/example/ios/PDFExampleTests/PDFExampleTests.m b/example/ios/PDFExampleTests/PDFExampleTests.m deleted file mode 100644 index 0ba7054f..00000000 --- a/example/ios/PDFExampleTests/PDFExampleTests.m +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" - -@interface PDFExampleTests : XCTestCase - -@end - -@implementation PDFExampleTests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; - RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - - RCTSetLogFunction(RCTDefaultLogFunction); - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - - -@end diff --git a/example/ios/Podfile b/example/ios/Podfile deleted file mode 100644 index db539f82..00000000 --- a/example/ios/Podfile +++ /dev/null @@ -1,47 +0,0 @@ -platform :ios, '9.0' -require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' - -target 'PDFExample' do - # Pods for PDFExample - pod 'React', :path => '../node_modules/react-native/' - pod 'React-Core', :path => '../node_modules/react-native/React' - pod 'React-DevSupport', :path => '../node_modules/react-native/React' - pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook' - pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' - pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' - pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' - pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' - pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' - pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' - pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' - pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' - pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' - pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket' - - pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' - pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' - pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' - pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' - pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' - - pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' - pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' - pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' - - target 'PDFExampleTests' do - inherit! :search_paths - # Pods for testing - end - - use_native_modules! -end - -target 'PDFExample-tvOS' do - # Pods for PDFExample-tvOS - - target 'PDFExample-tvOSTests' do - inherit! :search_paths - # Pods for testing - end - -end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock deleted file mode 100644 index c56c34f1..00000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,205 +0,0 @@ -PODS: - - boost-for-react-native (1.63.0) - - DoubleConversion (1.1.6) - - Folly (2018.10.22.00): - - boost-for-react-native - - DoubleConversion - - Folly/Default (= 2018.10.22.00) - - glog - - Folly/Default (2018.10.22.00): - - boost-for-react-native - - DoubleConversion - - glog - - glog (0.3.5) - - React (0.60.4): - - React-Core (= 0.60.4) - - React-DevSupport (= 0.60.4) - - React-RCTActionSheet (= 0.60.4) - - React-RCTAnimation (= 0.60.4) - - React-RCTBlob (= 0.60.4) - - React-RCTImage (= 0.60.4) - - React-RCTLinking (= 0.60.4) - - React-RCTNetwork (= 0.60.4) - - React-RCTSettings (= 0.60.4) - - React-RCTText (= 0.60.4) - - React-RCTVibration (= 0.60.4) - - React-RCTWebSocket (= 0.60.4) - - React-Core (0.60.4): - - Folly (= 2018.10.22.00) - - React-cxxreact (= 0.60.4) - - React-jsiexecutor (= 0.60.4) - - yoga (= 0.60.4.React) - - React-cxxreact (0.60.4): - - boost-for-react-native (= 1.63.0) - - DoubleConversion - - Folly (= 2018.10.22.00) - - glog - - React-jsinspector (= 0.60.4) - - React-DevSupport (0.60.4): - - React-Core (= 0.60.4) - - React-RCTWebSocket (= 0.60.4) - - React-fishhook (0.60.4) - - React-jsi (0.60.4): - - boost-for-react-native (= 1.63.0) - - DoubleConversion - - Folly (= 2018.10.22.00) - - glog - - React-jsi/Default (= 0.60.4) - - React-jsi/Default (0.60.4): - - boost-for-react-native (= 1.63.0) - - DoubleConversion - - Folly (= 2018.10.22.00) - - glog - - React-jsiexecutor (0.60.4): - - DoubleConversion - - Folly (= 2018.10.22.00) - - glog - - React-cxxreact (= 0.60.4) - - React-jsi (= 0.60.4) - - React-jsinspector (0.60.4) - - react-native-orientation-locker (1.1.6): - - React - - react-native-pdf (5.1.3): - - React - - React-RCTActionSheet (0.60.4): - - React-Core (= 0.60.4) - - React-RCTAnimation (0.60.4): - - React-Core (= 0.60.4) - - React-RCTBlob (0.60.4): - - React-Core (= 0.60.4) - - React-RCTNetwork (= 0.60.4) - - React-RCTWebSocket (= 0.60.4) - - React-RCTImage (0.60.4): - - React-Core (= 0.60.4) - - React-RCTNetwork (= 0.60.4) - - React-RCTLinking (0.60.4): - - React-Core (= 0.60.4) - - React-RCTNetwork (0.60.4): - - React-Core (= 0.60.4) - - React-RCTSettings (0.60.4): - - React-Core (= 0.60.4) - - React-RCTText (0.60.4): - - React-Core (= 0.60.4) - - React-RCTVibration (0.60.4): - - React-Core (= 0.60.4) - - React-RCTWebSocket (0.60.4): - - React-Core (= 0.60.4) - - React-fishhook (= 0.60.4) - - rn-fetch-blob (0.10.16): - - React-Core - - yoga (0.60.4.React) - -DEPENDENCIES: - - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) - - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - - React (from `../node_modules/react-native/`) - - React-Core (from `../node_modules/react-native/React`) - - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) - - React-DevSupport (from `../node_modules/react-native/React`) - - React-fishhook (from `../node_modules/react-native/Libraries/fishhook`) - - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - - react-native-orientation-locker (from `../node_modules/react-native-orientation-locker`) - - react-native-pdf (from `../node_modules/react-native-pdf`) - - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) - - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) - - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) - - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) - - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) - - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) - - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) - - React-RCTText (from `../node_modules/react-native/Libraries/Text`) - - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - - React-RCTWebSocket (from `../node_modules/react-native/Libraries/WebSocket`) - - rn-fetch-blob (from `../node_modules/rn-fetch-blob`) - - yoga (from `../node_modules/react-native/ReactCommon/yoga`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - boost-for-react-native - -EXTERNAL SOURCES: - DoubleConversion: - :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" - Folly: - :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" - glog: - :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" - React: - :path: "../node_modules/react-native/" - React-Core: - :path: "../node_modules/react-native/React" - React-cxxreact: - :path: "../node_modules/react-native/ReactCommon/cxxreact" - React-DevSupport: - :path: "../node_modules/react-native/React" - React-fishhook: - :path: "../node_modules/react-native/Libraries/fishhook" - React-jsi: - :path: "../node_modules/react-native/ReactCommon/jsi" - React-jsiexecutor: - :path: "../node_modules/react-native/ReactCommon/jsiexecutor" - React-jsinspector: - :path: "../node_modules/react-native/ReactCommon/jsinspector" - react-native-orientation-locker: - :path: "../node_modules/react-native-orientation-locker" - react-native-pdf: - :path: "../node_modules/react-native-pdf" - React-RCTActionSheet: - :path: "../node_modules/react-native/Libraries/ActionSheetIOS" - React-RCTAnimation: - :path: "../node_modules/react-native/Libraries/NativeAnimation" - React-RCTBlob: - :path: "../node_modules/react-native/Libraries/Blob" - React-RCTImage: - :path: "../node_modules/react-native/Libraries/Image" - React-RCTLinking: - :path: "../node_modules/react-native/Libraries/LinkingIOS" - React-RCTNetwork: - :path: "../node_modules/react-native/Libraries/Network" - React-RCTSettings: - :path: "../node_modules/react-native/Libraries/Settings" - React-RCTText: - :path: "../node_modules/react-native/Libraries/Text" - React-RCTVibration: - :path: "../node_modules/react-native/Libraries/Vibration" - React-RCTWebSocket: - :path: "../node_modules/react-native/Libraries/WebSocket" - rn-fetch-blob: - :path: "../node_modules/rn-fetch-blob" - yoga: - :path: "../node_modules/react-native/ReactCommon/yoga" - -SPEC CHECKSUMS: - boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c - DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 - Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 - glog: 1f3da668190260b06b429bb211bfbee5cd790c28 - React: ff7ee2ae5ee1c1d9ae2183b4111045b25294bb01 - React-Core: 8e0ea421cae5609d2562850f98421b15030476fa - React-cxxreact: 326880209990151a7182a813311054e9772ba510 - React-DevSupport: e9f10e6721e78e87622fc985db695c0c0168db8a - React-fishhook: 1f0e5b08449403fa75c3fb3881a0beefbada14af - React-jsi: 21d3153b1153fbf6510a92b6b11e33e725cb7432 - React-jsiexecutor: 7549641e48bafae7bfee3f3ea19bf4901639c5de - React-jsinspector: 73f24a02fa684ed6a2b828ba116874a2191ded88 - react-native-orientation-locker: 23918c400376a7043e752c639c122fcf6bce8f1c - react-native-pdf: 4ac64df95050555cce80d69c7e798322e1be4e6b - React-RCTActionSheet: 9f71d7ae3e8fb10e08d162cbf14c621349dbfab3 - React-RCTAnimation: 981d8c95b0e30918a9832ccac32af83562a27fae - React-RCTBlob: 21e73d1020a302a75fed30dbaee9f15287b80baa - React-RCTImage: c0bc6ac0926517b6fb7e4c279b04843113e99d1d - React-RCTLinking: 1af3f3c59114bed3deec0107c62e7efad0932ee5 - React-RCTNetwork: 35df9de46e19cda5c56380be1a7759b9b8cb2fcd - React-RCTSettings: f580504c2cd1f44e25add10fb9ed3954f67f8ac5 - React-RCTText: e0f224898b13af9aa036ea7cb3d438daa68c1044 - React-RCTVibration: 0bea40cd51bd089bd591a8f74c86e91fdf2666c5 - React-RCTWebSocket: 163873f4cdd5f1058a9483443404fc3801581cb6 - rn-fetch-blob: 651b8d076b43d0d7aa294a3d9ec16c00aab8bef9 - yoga: c2c050f6ae6e222534760cc82f559b89214b67e2 - -PODFILE CHECKSUM: fa2ed14dc2ca3d3057253b0ab7351f9c47b7c163 - -COCOAPODS: 1.7.3 diff --git a/example/jest-windows/driver.setup.js b/example/jest-windows/driver.setup.js deleted file mode 100644 index 82ef541b..00000000 --- a/example/jest-windows/driver.setup.js +++ /dev/null @@ -1,12 +0,0 @@ -import { windowsAppDriverCapabilities } from 'selenium-appium' - -switch (platform) { - case "windows": - const webViewWindowsAppId = 'PDFExample_nsp2ha5jnb6xr!App'; - module.exports = { - capabilites: windowsAppDriverCapabilities(webViewWindowsAppId) - } - break; - default: - throw "Unknown platform: " + platform; -} \ No newline at end of file diff --git a/example/jest-windows/jest.setup.js b/example/jest-windows/jest.setup.js deleted file mode 100644 index 32f556c8..00000000 --- a/example/jest-windows/jest.setup.js +++ /dev/null @@ -1 +0,0 @@ -platform = "windows" diff --git a/example/jest.windows.config.js b/example/jest.windows.config.js deleted file mode 100644 index eaa30a4a..00000000 --- a/example/jest.windows.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - testMatch: ['**/__windows_tests__/**/*.[jt]s?(x)'], - setupFiles: ['./jest-windows/jest.setup.js'] -} \ No newline at end of file diff --git a/example/metro.config.js b/example/metro.config.js deleted file mode 100644 index 1b710a4d..00000000 --- a/example/metro.config.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Metro configuration for React Native - * https://github.com/facebook/react-native - * - * @format - */ -const path = require('path'); -const blacklist = require('metro-config/src/defaults/blacklist'); - -module.exports = { - resolver: { - blacklistRE: blacklist([ - // This stops "react-native run-windows" from causing the metro server to crash if its already running - new RegExp( - `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`, - ), - // This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip - /.*\.ProjectImports\.zip/, - ]), - }, - transformer: { - getTransformOptions: async () => ({ - transform: { - experimentalImportSupport: false, - inlineRequires: false, - }, - }), - }, -}; diff --git a/example/package.json b/example/package.json deleted file mode 100644 index 4b2d5e16..00000000 --- a/example/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "PDFExample", - "version": "0.0.1", - "private": true, - "scripts": { - "appium": "appium", - "start": "react-native start", - "clean": "yarn clean_native_builds && yarn clean_react_native && yarn clean_node_modules", - "clean_native_builds": "rm -rf ios/build && rm -rf android/build/* && rm -rf android/app/build/* && rm -rf ios/Build", - "clean_react_native": "rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-* && watchman watch-del-all && lsof -n -i4TCP:8081 | sed '1 d' | awk '{print $2}' | xargs kill -9", - "clean_node_modules": "rm -rf node_modules/ && yarn cache clean && yarn", - "test": "jest", - "test:windows": "yarn jest --config=./jest.windows.config.js --runInBand", - "lint": "eslint ." - }, - "author": { - "name": "Wonday", - "url": "https://github.com/wonday" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/wonday/react-native-pdf/issues" - }, - "dependencies": { - "react": "16.13.1", - "react-native": "0.63.2", - "react-native-orientation-locker": "^1.1.6", - "react-native-pdf": "file:../", - "react-native-windows": "^0.63.11", - "react-native-blob-util": "^0.13.14" - }, - "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/runtime": "^7.5.5", - "@react-native-community/eslint-config": "^0.0.5", - "appium": "1.18.3", - "babel-jest": "^24.8.0", - "eslint": "^6.0.1", - "jest": "^24.8.0", - "metro-react-native-babel-preset": "^0.55.0", - "react-test-renderer": "16.13.1", - "selenium-appium": "0.0.15", - "selenium-webdriver": "4.0.0-alpha.7" - }, - "jest": { - "preset": "react-native" - } -} \ No newline at end of file diff --git a/example/test.pdf b/example/test.pdf deleted file mode 100644 index 9118d2b1..00000000 Binary files a/example/test.pdf and /dev/null differ diff --git a/example/windows/.gitignore b/example/windows/.gitignore deleted file mode 100644 index 4ea0c7b5..00000000 --- a/example/windows/.gitignore +++ /dev/null @@ -1,92 +0,0 @@ -*AppPackages* -*BundleArtifacts* - -#OS junk files -[Tt]humbs.db -*.DS_Store - -#Visual Studio files -*.[Oo]bj -*.user -*.aps -*.pch -*.vspscc -*.vssscc -*_i.c -*_p.c -*.ncb -*.suo -*.tlb -*.tlh -*.bak -*.[Cc]ache -*.ilk -*.log -*.lib -*.sbr -*.sdf -*.opensdf -*.opendb -*.unsuccessfulbuild -ipch/ -[Oo]bj/ -[Bb]in -[Dd]ebug*/ -[Rr]elease*/ -Ankh.NoLoad - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -#MonoDevelop -*.pidb -*.userprefs - -#Tooling -_ReSharper*/ -*.resharper -[Tt]est[Rr]esult* -*.sass-cache - -#Project files -[Bb]uild/ - -#Subversion files -.svn - -# Office Temp Files -~$* - -# vim Temp Files -*~ - -#NuGet -packages/ -*.nupkg - -#ncrunch -*ncrunch* -*crunch*.local.xml - -# visual studio database projects -*.dbmdl - -#Test files -*.testsettings - -#Other files -*.DotSettings -.vs/ -*project.lock.json - -#Files generated by the VS build -**/Generated Files/** - diff --git a/example/windows/PDFExample.sln b/example/windows/PDFExample.sln deleted file mode 100644 index 2a7a3392..00000000 --- a/example/windows/PDFExample.sln +++ /dev/null @@ -1,262 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29215.179 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PDFExample", "PDFExample\PDFExample.vcxproj", "{95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}" - ProjectSection(ProjectDependencies) = postProject - {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {F7D32BD0-2749-483E-9A0D-1635EF7E3136} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\node_modules\react-native-windows\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}" - ProjectSection(ProjectDependencies) = postProject - {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\node_modules\react-native-windows\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Shared", "..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems", "{0CC28589-39E4-4288-B162-97B959F8B843}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Universal", "..\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj", "{A62D504A-16B8-41D2-9F19-E2E86019E5E4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\node_modules\react-native-windows\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Shared", "..\node_modules\react-native-windows\Shared\Shared.vcxitems", "{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\node_modules\react-native-windows\Mso\Mso.vcxitems", "{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Include", "..\node_modules\react-native-windows\include\Include.vcxitems", "{EF074BA1-2D54-4D49-A28E-5E040B47CD2E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ReactNative.Managed", "..\node_modules\react-native-windows\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.csproj", "{F2824844-CE15-4242-9420-308923CD76C3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ReactNative.Managed.CodeGen", "..\node_modules\react-native-windows\Microsoft.ReactNative.Managed.CodeGen\Microsoft.ReactNative.Managed.CodeGen.csproj", "{ADED4FBE-887D-4271-AF24-F0823BCE7961}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RCTPdf", "..\node_modules\react-native-pdf\windows\RCTPdf\RCTPdf.vcxproj", "{03B8503F-F40D-4013-829C-71B304537D90}" -EndProject -Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - ..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{0cc28589-39e4-4288-b162-97b959f8b843}*SharedItemsImports = 9 - ..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9 - ..\node_modules\react-native-windows\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9 - ..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4 - ..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9 - ..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{ca54a654-5e81-44dc-af3f-cf55ef5b493a}*SharedItemsImports = 4 - ..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9 - ..\node_modules\react-native-windows\include\Include.vcxitems*{ef074ba1-2d54-4d49-a28e-5e040b47cd2e}*SharedItemsImports = 9 - ..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 - ..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 - ..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 - ..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|ARM.ActiveCfg = Debug|ARM - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|ARM.Build.0 = Debug|ARM - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|ARM.Deploy.0 = Debug|ARM - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|ARM64.Build.0 = Debug|ARM64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|x64.ActiveCfg = Debug|x64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|x64.Build.0 = Debug|x64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|x64.Deploy.0 = Debug|x64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|x86.ActiveCfg = Debug|Win32 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|x86.Build.0 = Debug|Win32 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Debug|x86.Deploy.0 = Debug|Win32 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|ARM.ActiveCfg = Release|ARM - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|ARM.Build.0 = Release|ARM - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|ARM.Deploy.0 = Release|ARM - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|ARM64.ActiveCfg = Release|ARM64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|ARM64.Build.0 = Release|ARM64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|ARM64.Deploy.0 = Release|ARM64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|x64.ActiveCfg = Release|x64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|x64.Build.0 = Release|x64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|x64.Deploy.0 = Release|x64 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|x86.ActiveCfg = Release|Win32 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|x86.Build.0 = Release|Win32 - {95F9323C-1039-4B6A-B69E-A9EFDDFEFB54}.Release|x86.Deploy.0 = Release|Win32 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM.ActiveCfg = Debug|ARM - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM.Build.0 = Debug|ARM - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM.ActiveCfg = Release|ARM - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM.Build.0 = Release|ARM - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32 - {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.ActiveCfg = Debug|ARM - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.Build.0 = Debug|ARM - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM.ActiveCfg = Release|ARM - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM.Build.0 = Release|ARM - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32 - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.ActiveCfg = Debug|ARM - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.Build.0 = Debug|ARM - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.ActiveCfg = Release|ARM - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.Build.0 = Release|ARM - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32 - {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM.ActiveCfg = Debug|ARM - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM.Build.0 = Debug|ARM - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM64.Build.0 = Debug|ARM64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x64.ActiveCfg = Debug|x64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x64.Build.0 = Debug|x64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x86.ActiveCfg = Debug|Win32 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x86.Build.0 = Debug|Win32 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM.ActiveCfg = Release|ARM - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM.Build.0 = Release|ARM - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM64.ActiveCfg = Release|ARM64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM64.Build.0 = Release|ARM64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x64.ActiveCfg = Release|x64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x64.Build.0 = Release|x64 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x86.ActiveCfg = Release|Win32 - {A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x86.Build.0 = Release|Win32 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM.ActiveCfg = Debug|ARM - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM.Build.0 = Debug|ARM - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM.ActiveCfg = Release|ARM - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM.Build.0 = Release|ARM - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32 - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32 - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|ARM.ActiveCfg = Debug|ARM - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|ARM.Build.0 = Debug|ARM - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|ARM64.Build.0 = Debug|ARM64 - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|x64.ActiveCfg = Debug|x64 - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|x64.Build.0 = Debug|x64 - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|x86.ActiveCfg = Debug|x86 - {F2824844-CE15-4242-9420-308923CD76C3}.Debug|x86.Build.0 = Debug|x86 - {F2824844-CE15-4242-9420-308923CD76C3}.Release|ARM.ActiveCfg = Release|ARM - {F2824844-CE15-4242-9420-308923CD76C3}.Release|ARM.Build.0 = Release|ARM - {F2824844-CE15-4242-9420-308923CD76C3}.Release|ARM64.ActiveCfg = Release|ARM64 - {F2824844-CE15-4242-9420-308923CD76C3}.Release|ARM64.Build.0 = Release|ARM64 - {F2824844-CE15-4242-9420-308923CD76C3}.Release|x64.ActiveCfg = Release|x64 - {F2824844-CE15-4242-9420-308923CD76C3}.Release|x64.Build.0 = Release|x64 - {F2824844-CE15-4242-9420-308923CD76C3}.Release|x86.ActiveCfg = Release|x86 - {F2824844-CE15-4242-9420-308923CD76C3}.Release|x86.Build.0 = Release|x86 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|ARM.ActiveCfg = Debug|ARM - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|ARM.Build.0 = Debug|ARM - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|ARM64.Build.0 = Debug|ARM64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|x64.ActiveCfg = Debug|x64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|x64.Build.0 = Debug|x64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|x86.ActiveCfg = Debug|x86 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Debug|x86.Build.0 = Debug|x86 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|ARM.ActiveCfg = Release|ARM - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|ARM.Build.0 = Release|ARM - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|ARM64.ActiveCfg = Release|ARM64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|ARM64.Build.0 = Release|ARM64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|x64.ActiveCfg = Release|x64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|x64.Build.0 = Release|x64 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|x86.ActiveCfg = Release|x86 - {ADED4FBE-887D-4271-AF24-F0823BCE7961}.Release|x86.Build.0 = Release|x86 - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|ARM.ActiveCfg = Debug|ARM - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|ARM.Build.0 = Debug|ARM - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|ARM64.Build.0 = Debug|ARM64 - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|x64.ActiveCfg = Debug|x64 - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|x64.Build.0 = Debug|x64 - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|x86.ActiveCfg = Debug|Win32 - {03B8503F-F40D-4013-829C-71B304537D90}.Debug|x86.Build.0 = Debug|Win32 - {03B8503F-F40D-4013-829C-71B304537D90}.Release|ARM.ActiveCfg = Release|ARM - {03B8503F-F40D-4013-829C-71B304537D90}.Release|ARM.Build.0 = Release|ARM - {03B8503F-F40D-4013-829C-71B304537D90}.Release|ARM64.ActiveCfg = Release|ARM64 - {03B8503F-F40D-4013-829C-71B304537D90}.Release|ARM64.Build.0 = Release|ARM64 - {03B8503F-F40D-4013-829C-71B304537D90}.Release|x64.ActiveCfg = Release|x64 - {03B8503F-F40D-4013-829C-71B304537D90}.Release|x64.Build.0 = Release|x64 - {03B8503F-F40D-4013-829C-71B304537D90}.Release|x86.ActiveCfg = Release|Win32 - {03B8503F-F40D-4013-829C-71B304537D90}.Release|x86.Build.0 = Release|Win32 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|ARM.ActiveCfg = Debug|ARM - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|ARM.Build.0 = Debug|ARM - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|ARM64.Build.0 = Debug|ARM64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|x64.ActiveCfg = Debug|x64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|x64.Build.0 = Debug|x64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|x86.ActiveCfg = Debug|Win32 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|x86.Build.0 = Debug|Win32 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Debug|x86.Deploy.0 = Debug|Win32 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|ARM.ActiveCfg = Release|ARM - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|ARM.Build.0 = Release|ARM - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|ARM64.ActiveCfg = Release|ARM64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|ARM64.Build.0 = Release|ARM64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|x64.ActiveCfg = Release|x64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|x64.Build.0 = Release|x64 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|x86.ActiveCfg = Release|Win32 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|x86.Build.0 = Release|Win32 - {CA54A654-5E81-44DC-AF3F-CF55EF5B493A}.Release|x86.Deploy.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {0CC28589-39E4-4288-B162-97B959F8B843} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {A62D504A-16B8-41D2-9F19-E2E86019E5E4} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {2049DBE9-8D13-42C9-AE4B-413AE38FFFD0} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {EF074BA1-2D54-4D49-A28E-5E040B47CD2E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {F2824844-CE15-4242-9420-308923CD76C3} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - {ADED4FBE-887D-4271-AF24-F0823BCE7961} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A} - EndGlobalSection -EndGlobal diff --git a/example/windows/PDFExample/.gitignore b/example/windows/PDFExample/.gitignore deleted file mode 100644 index 917243bd..00000000 --- a/example/windows/PDFExample/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Bundle diff --git a/example/windows/PDFExample/App.cpp b/example/windows/PDFExample/App.cpp deleted file mode 100644 index d21b7c72..00000000 --- a/example/windows/PDFExample/App.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "pch.h" - -#include "App.h" - -#include "AutolinkedNativeModules.g.h" -#include "ReactPackageProvider.h" - - -using namespace winrt::PDFExample; -using namespace winrt::PDFExample::implementation; -using namespace winrt; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Navigation; -using namespace Windows::ApplicationModel; - -/// -/// Initializes the singleton application object. This is the first line of -/// authored code executed, and as such is the logical equivalent of main() or -/// WinMain(). -/// -App::App() noexcept -{ -#if BUNDLE - JavaScriptBundleFile(L"index.windows"); - InstanceSettings().UseWebDebugger(false); - InstanceSettings().UseFastRefresh(false); -#else - JavaScriptMainModuleName(L"index"); - InstanceSettings().UseWebDebugger(true); - InstanceSettings().UseFastRefresh(true); -#endif - -#if _DEBUG - InstanceSettings().UseDeveloperSupport(true); -#else - InstanceSettings().UseDeveloperSupport(false); -#endif - - RegisterAutolinkedNativeModulePackages(PackageProviders()); // Includes any autolinked modules - - PackageProviders().Append(make()); // Includes all modules in this project - PackageProviders().Append(winrt::progress_view::ReactPackageProvider()); - InitializeComponent(); -} - -/// -/// Invoked when the application is launched normally by the end user. Other entry points -/// will be used such as when the application is launched to open a specific file. -/// -/// Details about the launch request and process. -void App::OnLaunched(activation::LaunchActivatedEventArgs const& e) -{ - super::OnLaunched(e); - - Frame rootFrame = Window::Current().Content().as(); - rootFrame.Navigate(xaml_typename(), box_value(e.Arguments())); -} - -/// -/// Invoked when application execution is being suspended. Application state is saved -/// without knowing whether the application will be terminated or resumed with the contents -/// of memory still intact. -/// -/// The source of the suspend request. -/// Details about the suspend request. -void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e) -{ - // Save application state and stop any background activity -} - -/// -/// Invoked when Navigation to a certain page fails -/// -/// The Frame which failed navigation -/// Details about the navigation failure -void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e) -{ - throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name); -} diff --git a/example/windows/PDFExample/App.h b/example/windows/PDFExample/App.h deleted file mode 100644 index e94396f5..00000000 --- a/example/windows/PDFExample/App.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "App.xaml.g.h" - -namespace activation = winrt::Windows::ApplicationModel::Activation; - -namespace winrt::PDFExample::implementation -{ - struct App : AppT - { - App() noexcept; - void OnLaunched(activation::LaunchActivatedEventArgs const&); - void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&); - void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&); - private: - using super = AppT; - }; -} // namespace winrt::PDFExample::implementation - - diff --git a/example/windows/PDFExample/App.idl b/example/windows/PDFExample/App.idl deleted file mode 100644 index 0c75a56d..00000000 --- a/example/windows/PDFExample/App.idl +++ /dev/null @@ -1,3 +0,0 @@ -namespace PDFExample -{ -} diff --git a/example/windows/PDFExample/App.xaml b/example/windows/PDFExample/App.xaml deleted file mode 100644 index 5117f6f4..00000000 --- a/example/windows/PDFExample/App.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/example/windows/PDFExample/Assets/LockScreenLogo.scale-200.png b/example/windows/PDFExample/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 735f57ad..00000000 Binary files a/example/windows/PDFExample/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/example/windows/PDFExample/Assets/SplashScreen.scale-200.png b/example/windows/PDFExample/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 023e7f1f..00000000 Binary files a/example/windows/PDFExample/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/example/windows/PDFExample/Assets/Square150x150Logo.scale-200.png b/example/windows/PDFExample/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index af49fec1..00000000 Binary files a/example/windows/PDFExample/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/example/windows/PDFExample/Assets/Square44x44Logo.scale-200.png b/example/windows/PDFExample/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index ce342a2e..00000000 Binary files a/example/windows/PDFExample/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/example/windows/PDFExample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/example/windows/PDFExample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index f6c02ce9..00000000 Binary files a/example/windows/PDFExample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/example/windows/PDFExample/Assets/StoreLogo.png b/example/windows/PDFExample/Assets/StoreLogo.png deleted file mode 100644 index 7385b56c..00000000 Binary files a/example/windows/PDFExample/Assets/StoreLogo.png and /dev/null differ diff --git a/example/windows/PDFExample/Assets/Wide310x150Logo.scale-200.png b/example/windows/PDFExample/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 288995b3..00000000 Binary files a/example/windows/PDFExample/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/example/windows/PDFExample/AutolinkedNativeModules.g.cpp b/example/windows/PDFExample/AutolinkedNativeModules.g.cpp deleted file mode 100644 index 58eabd79..00000000 --- a/example/windows/PDFExample/AutolinkedNativeModules.g.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// AutolinkedNativeModules.g.cpp contents generated by "react-native autolink-windows" -// clang-format off -#include "pch.h" -#include "AutolinkedNativeModules.g.h" - -// Includes from react-native-pdf -#include - -namespace winrt::Microsoft::ReactNative -{ - -void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector const& packageProviders) -{ - // IReactPackageProviders from react-native-pdf - packageProviders.Append(winrt::RCTPdf::ReactPackageProvider()); -} - -} diff --git a/example/windows/PDFExample/AutolinkedNativeModules.g.h b/example/windows/PDFExample/AutolinkedNativeModules.g.h deleted file mode 100644 index 1bf5f894..00000000 --- a/example/windows/PDFExample/AutolinkedNativeModules.g.h +++ /dev/null @@ -1,10 +0,0 @@ -// AutolinkedNativeModules.g.h contents generated by "react-native autolink-windows" - -#pragma once - -namespace winrt::Microsoft::ReactNative -{ - -void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector const& packageProviders); - -} diff --git a/example/windows/PDFExample/AutolinkedNativeModules.g.props b/example/windows/PDFExample/AutolinkedNativeModules.g.props deleted file mode 100644 index f5db933f..00000000 --- a/example/windows/PDFExample/AutolinkedNativeModules.g.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/example/windows/PDFExample/AutolinkedNativeModules.g.targets b/example/windows/PDFExample/AutolinkedNativeModules.g.targets deleted file mode 100644 index c3cec5b0..00000000 --- a/example/windows/PDFExample/AutolinkedNativeModules.g.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - {03b8503f-f40d-4013-829c-71b304537d90} - - - diff --git a/example/windows/PDFExample/MainPage.cpp b/example/windows/PDFExample/MainPage.cpp deleted file mode 100644 index 9027fe33..00000000 --- a/example/windows/PDFExample/MainPage.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "pch.h" -#include "MainPage.h" -#if __has_include("MainPage.g.cpp") -#include "MainPage.g.cpp" -#endif - -#include "App.h" - - - -using namespace winrt; -using namespace Windows::UI::Xaml; - -namespace winrt::PDFExample::implementation -{ - MainPage::MainPage() - { - InitializeComponent(); - auto app = Application::Current().as(); - ReactRootView().ReactNativeHost(app->Host()); - } -} - - diff --git a/example/windows/PDFExample/MainPage.h b/example/windows/PDFExample/MainPage.h deleted file mode 100644 index 7c1579c9..00000000 --- a/example/windows/PDFExample/MainPage.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "MainPage.g.h" -#include - - -namespace winrt::PDFExample::implementation -{ - struct MainPage : MainPageT - { - MainPage(); - }; -} - -namespace winrt::PDFExample::factory_implementation -{ - struct MainPage : MainPageT - { - }; -} - - diff --git a/example/windows/PDFExample/MainPage.idl b/example/windows/PDFExample/MainPage.idl deleted file mode 100644 index dd74bbf0..00000000 --- a/example/windows/PDFExample/MainPage.idl +++ /dev/null @@ -1,8 +0,0 @@ -namespace PDFExample -{ - [default_interface] - runtimeclass MainPage : Windows.UI.Xaml.Controls.Page - { - MainPage(); - } -} diff --git a/example/windows/PDFExample/MainPage.xaml b/example/windows/PDFExample/MainPage.xaml deleted file mode 100644 index 37f0b163..00000000 --- a/example/windows/PDFExample/MainPage.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/example/windows/PDFExample/PDFExample.vcxproj b/example/windows/PDFExample/PDFExample.vcxproj deleted file mode 100644 index 854aff7d..00000000 --- a/example/windows/PDFExample/PDFExample.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - true - true - true - {95f9323c-1039-4b6a-b69e-a9efddfefb54} - PDFExample - PDFExample - en-US - 16.0 - true - Windows Store - 10.0 - 10.0.18362.0 - 10.0.16299.0 - PDFExample_TemporaryKey.pfx - E03C74524183D74C00377AF0154C246C9456C18F - password - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Release - x64 - - - - Application - Unicode - - - true - true - - - false - true - false - - - - - - - - - - - - - - - - - - Use - pch.h - $(IntDir)pch.pch - Level4 - %(AdditionalOptions) /bigobj - 4453;28204 - - - - - _DEBUG;%(PreprocessorDefinitions) - - - - - NDEBUG;%(PreprocessorDefinitions) - - - - - MainPage.xaml - Code - - - - - - App.xaml - - - - - Designer - - - - - Designer - - - - - - - - - - - - - - MainPage.xaml - Code - - - - - Create - - - App.xaml - - - - - - App.xaml - - - MainPage.xaml - Code - - - - - true - - - - - false - - - - - Designer - - - - - - - - - This project references targets in your node_modules\react-native-windows folder. The missing file is {0}. - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - \ No newline at end of file diff --git a/example/windows/PDFExample/PDFExample.vcxproj.filters b/example/windows/PDFExample/PDFExample.vcxproj.filters deleted file mode 100644 index 0f299790..00000000 --- a/example/windows/PDFExample/PDFExample.vcxproj.filters +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - - - - - - {e48dc53e-40b1-40cb-970a-f89935452892} - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example/windows/PDFExample/PDFExample_TemporaryKey.pfx b/example/windows/PDFExample/PDFExample_TemporaryKey.pfx deleted file mode 100644 index 2fb7facd..00000000 Binary files a/example/windows/PDFExample/PDFExample_TemporaryKey.pfx and /dev/null differ diff --git a/example/windows/PDFExample/Package.appxmanifest b/example/windows/PDFExample/Package.appxmanifest deleted file mode 100644 index 65067f9a..00000000 --- a/example/windows/PDFExample/Package.appxmanifest +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - PDFExample - ja - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example/windows/PDFExample/PropertySheet.props b/example/windows/PDFExample/PropertySheet.props deleted file mode 100644 index 5942ba39..00000000 --- a/example/windows/PDFExample/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/example/windows/PDFExample/ReactPackageProvider.cpp b/example/windows/PDFExample/ReactPackageProvider.cpp deleted file mode 100644 index 9a3b3bb0..00000000 --- a/example/windows/PDFExample/ReactPackageProvider.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "pch.h" -#include "ReactPackageProvider.h" -#include "NativeModules.h" - - -using namespace winrt::Microsoft::ReactNative; - -namespace winrt::PDFExample::implementation -{ - -void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept -{ - AddAttributedModules(packageBuilder); -} - -} // namespace winrt::PDFExample::implementation - - diff --git a/example/windows/PDFExample/ReactPackageProvider.h b/example/windows/PDFExample/ReactPackageProvider.h deleted file mode 100644 index 1be3c878..00000000 --- a/example/windows/PDFExample/ReactPackageProvider.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "winrt/Microsoft.ReactNative.h" - - -namespace winrt::PDFExample::implementation -{ - struct ReactPackageProvider : winrt::implements - { - public: // IReactPackageProvider - void CreatePackage(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept; - }; -} // namespace winrt::PDFExample::implementation - - diff --git a/example/windows/PDFExample/packages.config b/example/windows/PDFExample/packages.config deleted file mode 100644 index 7ad3ffb8..00000000 --- a/example/windows/PDFExample/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/example/windows/PDFExample/pch.cpp b/example/windows/PDFExample/pch.cpp deleted file mode 100644 index bcb5590b..00000000 --- a/example/windows/PDFExample/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pch.h" diff --git a/example/windows/PDFExample/pch.h b/example/windows/PDFExample/pch.h deleted file mode 100644 index e3d762be..00000000 --- a/example/windows/PDFExample/pch.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define NOMINMAX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include "winrt/RCTPdf.h" -#include "winrt/progress_view.h" diff --git a/fabric/RNPDFPdfNativeComponent.js b/fabric/RNPDFPdfNativeComponent.js new file mode 100644 index 00000000..e9be0dbd --- /dev/null +++ b/fabric/RNPDFPdfNativeComponent.js @@ -0,0 +1,52 @@ +/** + * @flow + * @format + */ + 'use strict'; + + import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; + import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; + + type ChangeEvent = $ReadOnly<{| + message: ?string, + |}>; + + export type NativeProps = $ReadOnly<{| + ...ViewProps, + path: ?string, + page: ?Int32, + hotspots: ?string, + notes: ?string, + textNotes: ?string, + enableMovement: ?boolean, + scale: ?Float, + minScale: ?Float, + maxScale: ?Float, + horizontal: ?boolean, + enablePaging: ?boolean, + enableRTL: ?boolean, + enableAnnotationRendering: ?boolean, + showsHorizontalScrollIndicator: ?boolean, + showsVerticalScrollIndicator: ?boolean, + scrollEnabled: ?boolean, + enableAntialiasing: ?boolean, + enableDoubleTapZoom: ?boolean, + fitPolicy: ?Int32, + spacing: ?Int32, + password: ?string, + onChange: ?BubblingEventHandler, + singlePage: ?boolean, + |}>; + + interface NativeCommands { + +setNativePage: ( + viewRef: React.ElementRef, + page: Int32, + ) => void; +} + +export const Commands: NativeCommands = codegenNativeCommands({ + supportedCommands: ['setNativePage'], +}); + + export default codegenNativeComponent('RNPDFPdfView'); diff --git a/index.d.ts b/index.d.ts index c54c8ba7..c75e1c37 100644 --- a/index.d.ts +++ b/index.d.ts @@ -27,14 +27,18 @@ export type Source = { method?: string; }; -interface Props { +export interface PdfProps { style?: ReactNative.StyleProp, + progressContainerStyle?: ReactNative.StyleProp, source: Source | number, page?: number, scale?: number, minScale?: number, maxScale?: number, horizontal?: boolean, + showsHorizontalScrollIndicator?: boolean, + showsVerticalScrollIndicator?: boolean, + scrollEnabled?: boolean, spacing?: number, password?: string, renderActivityIndicator?: (progress: number) => React.ReactElement, @@ -42,7 +46,14 @@ interface Props { enablePaging?: boolean, enableRTL?: boolean, enableAnnotationRendering?: boolean, - fitPolicy?: number, + enableDoubleTapZoom?: boolean; + /** + * Fit policy. This will adjust the initial zoom of the PDF based on the initial size of the view and the scale factor. + * 0 = fit width + * 1 = fit height + * 2 = fit both + */ + fitPolicy?: 0 | 1 | 2, trustAllCerts?: boolean, singlePage?: boolean, onLoadProgress?: (percent: number,) => void, @@ -54,7 +65,7 @@ interface Props { onPressLink?: (url: string) => void, } -declare class Pdf extends React.Component { +declare class Pdf extends React.Component { setPage: (pageNumber: number) => void; } diff --git a/index.js b/index.js index 10d65e42..c2facf26 100644 --- a/index.js +++ b/index.js @@ -10,17 +10,18 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import { - requireNativeComponent, View, Platform, - ViewPropTypes, StyleSheet, Image, - Text + Text, + requireNativeComponent } from 'react-native'; - +import PdfViewNativeComponent, { + Commands as PdfViewCommands, + } from './fabric/RNPDFPdfNativeComponent'; import ReactNativeBlobUtil from 'react-native-blob-util' - +import {ViewPropTypes} from 'deprecated-react-native-prop-types'; const SHA1 = require('crypto-js/sha1'); import PdfView from './PdfView'; @@ -45,9 +46,17 @@ export default class Pdf extends Component { horizontal: PropTypes.bool, spacing: PropTypes.number, password: PropTypes.string, + hotspots: PropTypes.string, + notes: PropTypes.string, + textNotes: PropTypes.string, + enableMovement: PropTypes.bool, + update: PropTypes.bool, renderActivityIndicator: PropTypes.func, enableAntialiasing: PropTypes.bool, enableAnnotationRendering: PropTypes.bool, + showsHorizontalScrollIndicator: PropTypes.bool, + showsVerticalScrollIndicator: PropTypes.bool, + scrollEnabled: PropTypes.bool, enablePaging: PropTypes.bool, enableRTL: PropTypes.bool, fitPolicy: PropTypes.number, @@ -72,6 +81,11 @@ export default class Pdf extends Component { static defaultProps = { password: "", + hotspots: "", + notes: "", + textNotes:"", + update: false, + enableMovement:true, scale: 1, minScale: 1, maxScale: 3, @@ -81,6 +95,9 @@ export default class Pdf extends Component { page: 1, enableAntialiasing: true, enableAnnotationRendering: true, + showsHorizontalScrollIndicator: true, + showsVerticalScrollIndicator: true, + scrollEnabled: true, enablePaging: false, enableRTL: false, trustAllCerts: true, @@ -94,7 +111,7 @@ export default class Pdf extends Component { }, onError: (error) => { }, - onPageSingleTap: (page, x, y) => { + onPageSingleTap: (page, x, y, width, height) => { }, onScaleChanged: (scale) => { }, @@ -109,7 +126,6 @@ export default class Pdf extends Component { path: '', isDownloaded: false, progress: 0, - isSupportPDFKit: -1 }; this.lastRNBFTask = null; @@ -123,7 +139,7 @@ export default class Pdf extends Component { if ((nextSource.uri !== curSource.uri)) { // if has download task, then cancel it. - if (this.lastRNBFTask) { + if (this.lastRNBFTask && this.lastRNBFTask.cancel) { this.lastRNBFTask.cancel(err => { this._loadFromSource(this.props.source); }); @@ -136,22 +152,14 @@ export default class Pdf extends Component { componentDidMount() { this._mounted = true; - if (Platform.OS === "ios") { - const PdfViewManagerNative = require('react-native').NativeModules.PdfViewManager; - PdfViewManagerNative.supportPDFKit((isSupportPDFKit) => { - if (this._mounted) { - this.setState({isSupportPDFKit: isSupportPDFKit ? 1 : 0}); - } - }); - } this._loadFromSource(this.props.source); } componentWillUnmount() { this._mounted = false; if (this.lastRNBFTask) { - this.lastRNBFTask.cancel(err => { - }); + // this.lastRNBFTask.cancel(err => { + // }); this.lastRNBFTask = null; } @@ -237,7 +245,7 @@ export default class Pdf extends Component { } else { if (this._mounted) { this.setState({ - path: uri.replace(/file:\/\//i, ''), + path: decodeURIComponent(uri.replace(/file:\/\//i, '')), isDownloaded: true, }); } @@ -280,6 +288,9 @@ export default class Pdf extends Component { if (this._mounted) { this.setState({progress: received / total}); } + }) + .catch(async (error) => { + this._onError(error); }); this.lastRNBFTask @@ -347,35 +358,91 @@ export default class Pdf extends Component { if ( (pageNumber === null) || (isNaN(pageNumber)) ) { throw new Error('Specified pageNumber is not a number'); } + if (!!global?.nativeFabricUIManager ) { + if (this._root) { + PdfViewCommands.setNativePage( + this._root, + pageNumber, + ); + } + } else { + this.setNativeProps({ + page: pageNumber + }); + } + + } + + + setHotspots(hotspots) { this.setNativeProps({ - page: pageNumber + hotspots: hotspots + }); + } + + + setNotes(notes) { + this.setNativeProps({ + notes: notes }); } - _onChange = (event) => { + setTextNotes(notes) { + this.setNativeProps({ + textNotes: notes + }); + } + + + setEnableMovement(enableMovement) { + this.setNativeProps({ + enableMovement: enableMovement + }); + } + + + _onChange = (event) => { let message = event.nativeEvent.message.split('|'); //__DEV__ && console.log("onChange: " + message); if (message.length > 0) { - if (message.length > 5) { + /*if (message.length > 5) { message[4] = message.splice(4).join('|'); - } + }*/ if (message[0] === 'loadComplete') { + let tableContents; + try { + tableContents = message[4]&&JSON.parse(message[4]); + } catch(e) { + tableContents = message[4]; + } this.props.onLoadComplete && this.props.onLoadComplete(Number(message[1]), this.state.path, { width: Number(message[2]), height: Number(message[3]), }, - message[4]&&JSON.parse(message[4])); + tableContents + ); } else if (message[0] === 'pageChanged') { this.props.onPageChanged && this.props.onPageChanged(Number(message[1]), Number(message[2])); } else if (message[0] === 'error') { this._onError(new Error(message[1])); } else if (message[0] === 'pageSingleTap') { - this.props.onPageSingleTap && this.props.onPageSingleTap(Number(message[1]), Number(message[2]), Number(message[3])); + this.props.onPageSingleTap && this.props.onPageSingleTap(Number(message[1]), Number(message[2]), Number(message[3]), Number(message[4]), Number(message[5])); + } else if (message[0] === 'pageScrolled') { + this.props.onPageScrolled && this.props.onPageScrolled(message[1], message[2], message[3]); } else if (message[0] === 'scaleChanged') { this.props.onScaleChanged && this.props.onScaleChanged(Number(message[1])); } else if (message[0] === 'linkPressed') { this.props.onPressLink && this.props.onPressLink(message[1]); + } else if (message[0] === 'pageScrolledEnd') { + this.props.onPageScrolledEnd && this.props.onPageScrolledEnd(Number(message[1]), Number(message[2]), Number(message[3]), Number(message[4]), Number(message[5])); + } else if (message[0] === 'nextPage') { + this.props.onNextPage && this.props.onNextPage(); + } else if (message[0] === 'prevPage') { + this.props.onPrevPage && this.props.onPrevPage(); + } + else if (message[0] === 'actionEnd') { + this.props.onActionEnd && this.props.onActionEnd(Number(message[1]), Number(message[2]), Number(message[3]), Number(message[4]), Number(message[5]), Number(message[6])); } } @@ -393,7 +460,7 @@ export default class Pdf extends Component { {!this.state.isDownloaded? ( {this.props.renderActivityIndicator ? this.props.renderActivityIndicator(this.state.progress) @@ -408,7 +475,7 @@ export default class Pdf extends Component { onChange={this._onChange} /> ):( - this.props.usePDFKit && this.state.isSupportPDFKit === 1?( + this.props.usePDFKit ?( (this._root = component)} {...this.props} @@ -438,22 +505,14 @@ export default class Pdf extends Component { } } - -if (Platform.OS === "android") { - var PdfCustom = requireNativeComponent('RCTPdf', Pdf, { - nativeOnly: {path: true, onChange: true}, - }) -} else if (Platform.OS === "ios") { - var PdfCustom = requireNativeComponent('RCTPdfView', Pdf, { - nativeOnly: {path: true, onChange: true}, - }) -} else if (Platform.OS === "windows") { +if (Platform.OS === "android" || Platform.OS === "ios") { + var PdfCustom = PdfViewNativeComponent; +} else if (Platform.OS === "windows") { var PdfCustom = requireNativeComponent('RCTPdf', Pdf, { nativeOnly: {path: true, onChange: true}, }) } - const styles = StyleSheet.create({ progressContainer: { flex: 1, diff --git a/index.js.flow b/index.js.flow index 43d74dc4..693070a3 100644 --- a/index.js.flow +++ b/index.js.flow @@ -39,6 +39,9 @@ export type Props = { enableRTL?: boolean, fitPolicy?: FitWidth | FitHeight | FitBoth, horizontal?: boolean, + showsHorizontalScrollIndicator?: boolean, + showsVerticalScrollIndicator?: boolean, + scrollEnabled?: boolean, maxScale?: number, minScale?: number, singlePage?: boolean, @@ -51,6 +54,7 @@ export type Props = { onPressLink?: (url: string) => void, page?: number, password?: string, + progressContainerStyle?: ViewStyleProp, scale?: number, source: AssetId | Source, spacing?: number, diff --git a/ios/RCTPdf.xcodeproj/project.pbxproj b/ios/RNPDFPdf.xcodeproj/project.pbxproj similarity index 69% rename from ios/RCTPdf.xcodeproj/project.pbxproj rename to ios/RNPDFPdf.xcodeproj/project.pbxproj index ea379093..c57ffffe 100644 --- a/ios/RCTPdf.xcodeproj/project.pbxproj +++ b/ios/RNPDFPdf.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ - 5267DA06210F0EDE00D20C59 /* RCTPdfView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA03210F0EDD00D20C59 /* RCTPdfView.m */; }; - 5267DA07210F0EDE00D20C59 /* RCTPdfViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA05210F0EDE00D20C59 /* RCTPdfViewManager.m */; }; + 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */; }; + 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */; }; 5267DA0A210F0F0800D20C59 /* PDFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5267DA09210F0F0800D20C59 /* PDFKit.framework */; }; - 526B80401EABD92200259970 /* RCTPdfPageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 526B803F1EABD92200259970 /* RCTPdfPageViewManager.m */; }; - 52A324EA1FD3C3FB000B0B18 /* PdfManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 52A324E91FD3C3FB000B0B18 /* PdfManager.m */; }; - 52F79DB71EB2DA4F00CAD00C /* RCTPdfPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 52F79DB41EB2DA4F00CAD00C /* RCTPdfPageView.m */; }; + 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.mm */; }; + 52A324EA1FD3C3FB000B0B18 /* PdfManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52A324E91FD3C3FB000B0B18 /* PdfManager.mm */; }; + 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -28,18 +28,18 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 20D8E03F1C8E946C00039823 /* libRCTPdf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTPdf.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 5267DA02210F0EDD00D20C59 /* RCTPdfView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfView.h; sourceTree = ""; }; - 5267DA03210F0EDD00D20C59 /* RCTPdfView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfView.m; sourceTree = ""; }; - 5267DA04210F0EDD00D20C59 /* RCTPdfViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfViewManager.h; sourceTree = ""; }; - 5267DA05210F0EDE00D20C59 /* RCTPdfViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfViewManager.m; sourceTree = ""; }; + 20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPDFPdf.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 5267DA02210F0EDD00D20C59 /* RNPDFPdfView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfView.h; sourceTree = ""; }; + 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfView.mm; sourceTree = ""; }; + 5267DA04210F0EDD00D20C59 /* RNPDFPdfViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfViewManager.h; sourceTree = ""; }; + 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfViewManager.mm; sourceTree = ""; }; 5267DA09210F0F0800D20C59 /* PDFKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PDFKit.framework; path = System/Library/Frameworks/PDFKit.framework; sourceTree = SDKROOT; }; - 526B803E1EABD92200259970 /* RCTPdfPageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfPageViewManager.h; sourceTree = ""; }; - 526B803F1EABD92200259970 /* RCTPdfPageViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfPageViewManager.m; sourceTree = ""; }; + 526B803E1EABD92200259970 /* RNPDFPdfPageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfPageViewManager.h; sourceTree = ""; }; + 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfPageViewManager.mm; sourceTree = ""; }; 52A324E81FD3C3FB000B0B18 /* PdfManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PdfManager.h; sourceTree = ""; }; - 52A324E91FD3C3FB000B0B18 /* PdfManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PdfManager.m; sourceTree = ""; }; - 52F79DB31EB2DA4F00CAD00C /* RCTPdfPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPdfPageView.h; sourceTree = ""; }; - 52F79DB41EB2DA4F00CAD00C /* RCTPdfPageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPdfPageView.m; sourceTree = ""; }; + 52A324E91FD3C3FB000B0B18 /* PdfManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PdfManager.mm; sourceTree = ""; }; + 52F79DB31EB2DA4F00CAD00C /* RNPDFPdfPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPDFPdfPageView.h; sourceTree = ""; }; + 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPDFPdfPageView.mm; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -57,7 +57,7 @@ 20D8E0361C8E946C00039823 = { isa = PBXGroup; children = ( - 20D8E0411C8E946C00039823 /* RCTPdf */, + 20D8E0411C8E946C00039823 /* RNPDFPdf */, 20D8E0401C8E946C00039823 /* Products */, 5267DA08210F0F0800D20C59 /* Frameworks */, ); @@ -66,26 +66,26 @@ 20D8E0401C8E946C00039823 /* Products */ = { isa = PBXGroup; children = ( - 20D8E03F1C8E946C00039823 /* libRCTPdf.a */, + 20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */, ); name = Products; sourceTree = ""; }; - 20D8E0411C8E946C00039823 /* RCTPdf */ = { + 20D8E0411C8E946C00039823 /* RNPDFPdf */ = { isa = PBXGroup; children = ( - 5267DA02210F0EDD00D20C59 /* RCTPdfView.h */, - 5267DA03210F0EDD00D20C59 /* RCTPdfView.m */, - 5267DA04210F0EDD00D20C59 /* RCTPdfViewManager.h */, - 5267DA05210F0EDE00D20C59 /* RCTPdfViewManager.m */, + 5267DA02210F0EDD00D20C59 /* RNPDFPdfView.h */, + 5267DA03210F0EDD00D20C59 /* RNPDFPdfView.mm */, + 5267DA04210F0EDD00D20C59 /* RNPDFPdfViewManager.h */, + 5267DA05210F0EDE00D20C59 /* RNPDFPdfViewManager.mm */, 52A324E81FD3C3FB000B0B18 /* PdfManager.h */, - 52A324E91FD3C3FB000B0B18 /* PdfManager.m */, - 52F79DB31EB2DA4F00CAD00C /* RCTPdfPageView.h */, - 52F79DB41EB2DA4F00CAD00C /* RCTPdfPageView.m */, - 526B803E1EABD92200259970 /* RCTPdfPageViewManager.h */, - 526B803F1EABD92200259970 /* RCTPdfPageViewManager.m */, + 52A324E91FD3C3FB000B0B18 /* PdfManager.mm */, + 52F79DB31EB2DA4F00CAD00C /* RNPDFPdfPageView.h */, + 52F79DB41EB2DA4F00CAD00C /* RNPDFPdfPageView.mm */, + 526B803E1EABD92200259970 /* RNPDFPdfPageViewManager.h */, + 526B803F1EABD92200259970 /* RNPDFPdfPageViewManager.mm */, ); - path = RCTPdf; + path = RNPDFPdf; sourceTree = ""; }; 5267DA08210F0F0800D20C59 /* Frameworks */ = { @@ -99,9 +99,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 20D8E03E1C8E946C00039823 /* RCTPdf */ = { + 20D8E03E1C8E946C00039823 /* RNPDFPdf */ = { isa = PBXNativeTarget; - buildConfigurationList = 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RCTPdf" */; + buildConfigurationList = 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RNPDFPdf" */; buildPhases = ( 20D8E03B1C8E946C00039823 /* Sources */, 20D8E03C1C8E946C00039823 /* Frameworks */, @@ -111,9 +111,9 @@ ); dependencies = ( ); - name = RCTPdf; - productName = RCTPdf; - productReference = 20D8E03F1C8E946C00039823 /* libRCTPdf.a */; + name = RNPDFPdf; + productName = RNPDFPdf; + productReference = 20D8E03F1C8E946C00039823 /* libRNPDFPdf.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -131,7 +131,7 @@ }; }; }; - buildConfigurationList = 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RCTPdf" */; + buildConfigurationList = 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RNPDFPdf" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -143,7 +143,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 20D8E03E1C8E946C00039823 /* RCTPdf */, + 20D8E03E1C8E946C00039823 /* RNPDFPdf */, ); }; /* End PBXProject section */ @@ -153,11 +153,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 52A324EA1FD3C3FB000B0B18 /* PdfManager.m in Sources */, - 5267DA07210F0EDE00D20C59 /* RCTPdfViewManager.m in Sources */, - 5267DA06210F0EDE00D20C59 /* RCTPdfView.m in Sources */, - 526B80401EABD92200259970 /* RCTPdfPageViewManager.m in Sources */, - 52F79DB71EB2DA4F00CAD00C /* RCTPdfPageView.m in Sources */, + 52A324EA1FD3C3FB000B0B18 /* PdfManager.mm in Sources */, + 5267DA07210F0EDE00D20C59 /* RNPDFPdfViewManager.mm in Sources */, + 5267DA06210F0EDE00D20C59 /* RNPDFPdfView.mm in Sources */, + 526B80401EABD92200259970 /* RNPDFPdfPageViewManager.mm in Sources */, + 52F79DB71EB2DA4F00CAD00C /* RNPDFPdfPageView.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -297,7 +297,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RCTPdf" */ = { + 20D8E03A1C8E946C00039823 /* Build configuration list for PBXProject "RNPDFPdf" */ = { isa = XCConfigurationList; buildConfigurations = ( 20D8E0461C8E946C00039823 /* Debug */, @@ -306,7 +306,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RCTPdf" */ = { + 20D8E0481C8E946C00039823 /* Build configuration list for PBXNativeTarget "RNPDFPdf" */ = { isa = XCConfigurationList; buildConfigurations = ( 20D8E0491C8E946C00039823 /* Debug */, diff --git a/ios/RCTPdf/PdfManager.h b/ios/RNPDFPdf/PdfManager.h similarity index 100% rename from ios/RCTPdf/PdfManager.h rename to ios/RNPDFPdf/PdfManager.h diff --git a/ios/RCTPdf/PdfManager.m b/ios/RNPDFPdf/PdfManager.mm similarity index 88% rename from ios/RCTPdf/PdfManager.m rename to ios/RNPDFPdf/PdfManager.mm index d2877c88..f004e73e 100644 --- a/ios/RCTPdf/PdfManager.m +++ b/ios/RNPDFPdf/PdfManager.mm @@ -50,7 +50,17 @@ @implementation PdfManager if (path != nil && path.length != 0) { - NSURL *pdfURL = [NSURL fileURLWithPath:path]; + NSString *decodedPath = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)path, CFSTR("")); + + NSString *finalPath = NULL; + if (decodedPath == NULL) { + // use orignal provided path + finalPath = path; + } else { + finalPath = decodedPath; + } + + NSURL *pdfURL = [NSURL fileURLWithPath:finalPath]; CGPDFDocumentRef pdfRef = CGPDFDocumentCreateWithURL((__bridge CFURLRef) pdfURL); if (pdfRef == NULL) { @@ -126,7 +136,7 @@ - (void)dealloc { // release pdf docs for(NSValue *item in pdfDocRefs) { - CGPDFDocumentRef pdfItem = [item pointerValue]; + CGPDFDocumentRef pdfItem = (CGPDFDocumentRef)[item pointerValue]; if (pdfItem != NULL) { CGPDFDocumentRelease(pdfItem); diff --git a/ios/RCTPdf/RCTPdfPageView.h b/ios/RNPDFPdf/RNPDFPdfPageView.h similarity index 91% rename from ios/RCTPdf/RCTPdfPageView.h rename to ios/RNPDFPdf/RNPDFPdfPageView.h index 09ff05b8..5e28cb61 100644 --- a/ios/RCTPdf/RCTPdfPageView.h +++ b/ios/RNPDFPdf/RNPDFPdfPageView.h @@ -13,7 +13,7 @@ #endif -@interface RCTPdfPageView : UIView +@interface RNPDFPdfPageView : UIView @property(nonatomic) int fileNo; @property(nonatomic) int page; diff --git a/ios/RCTPdf/RCTPdfPageView.m b/ios/RNPDFPdf/RNPDFPdfPageView.mm similarity index 96% rename from ios/RCTPdf/RCTPdfPageView.m rename to ios/RNPDFPdf/RNPDFPdfPageView.mm index 08f65291..07981ebf 100644 --- a/ios/RCTPdf/RCTPdfPageView.m +++ b/ios/RNPDFPdf/RNPDFPdfPageView.mm @@ -7,7 +7,7 @@ */ #import "PdfManager.h" -#import "RCTPdfPageView.h" +#import "RNPDFPdfPageView.h" @@ -37,15 +37,15 @@ #define RLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) @interface CAPdfLayer : CALayer --(void) setParentView:(RCTPdfPageView *)parentView; +-(void) setParentView:(RNPDFPdfPageView *)parentView; @end @implementation CAPdfLayer { - RCTPdfPageView *_parentView; + RNPDFPdfPageView *_parentView; } --(void) setParentView:(RCTPdfPageView *)parentView +-(void) setParentView:(RNPDFPdfPageView *)parentView { _parentView = parentView; } @@ -134,7 +134,7 @@ - (void)drawInContext:(CGContextRef)context } @end -@implementation RCTPdfPageView { +@implementation RNPDFPdfPageView { CAPdfLayer *_layer; } diff --git a/ios/RCTPdf/RCTPdfPageViewManager.h b/ios/RNPDFPdf/RNPDFPdfPageViewManager.h similarity index 86% rename from ios/RCTPdf/RCTPdfPageViewManager.h rename to ios/RNPDFPdf/RNPDFPdfPageViewManager.h index eb270684..b1ab4fb6 100644 --- a/ios/RCTPdf/RCTPdfPageViewManager.h +++ b/ios/RNPDFPdf/RNPDFPdfPageViewManager.h @@ -13,6 +13,6 @@ #endif -@interface RCTPdfPageViewManager : RCTViewManager +@interface RNPDFPdfPageViewManager : RCTViewManager @end diff --git a/ios/RCTPdf/RCTPdfPageViewManager.m b/ios/RNPDFPdf/RNPDFPdfPageViewManager.mm similarity index 74% rename from ios/RCTPdf/RCTPdfPageViewManager.m rename to ios/RNPDFPdf/RNPDFPdfPageViewManager.mm index e22c19a6..efd1015f 100644 --- a/ios/RCTPdf/RCTPdfPageViewManager.m +++ b/ios/RNPDFPdf/RNPDFPdfPageViewManager.mm @@ -8,17 +8,17 @@ #import -#import "RCTPdfPageViewManager.h" -#import "RCTPdfPageView.h" +#import "RNPDFPdfPageViewManager.h" +#import "RNPDFPdfPageView.h" -@implementation RCTPdfPageViewManager +@implementation RNPDFPdfPageViewManager RCT_EXPORT_MODULE() - (UIView *)view { - return [[RCTPdfPageView alloc] init]; + return [[RNPDFPdfPageView alloc] init]; } RCT_EXPORT_VIEW_PROPERTY(fileNo, int); diff --git a/ios/RCTPdf/RCTPdfView.h b/ios/RNPDFPdf/RNPDFPdfView.h similarity index 67% rename from ios/RCTPdf/RCTPdfView.h rename to ios/RNPDFPdf/RNPDFPdfView.h index f2a82d5c..b3a17c5a 100644 --- a/ios/RCTPdf/RCTPdfView.h +++ b/ios/RNPDFPdf/RNPDFPdfView.h @@ -6,8 +6,8 @@ * LICENSE file in the root directory of this source tree. */ -#ifndef RCTPdfView_h -#define RCTPdfView_h +#ifndef RNPDFPdfView_h +#define RNPDFPdfView_h #if __has_include() #import @@ -17,11 +17,19 @@ #import "UIView+React.h" #endif +#ifdef RCT_NEW_ARCH_ENABLED +#import +#endif @class RCTEventDispatcher; -NS_CLASS_AVAILABLE_IOS(11_0) @interface RCTPdfView : UIView - +NS_CLASS_AVAILABLE_IOS(11_0) @interface RNPDFPdfView : +#ifdef RCT_NEW_ARCH_ENABLED +RCTViewComponentView +#else +UIView +#endif + - (instancetype)initWithBridge:(RCTBridge *)bridge; @property(nonatomic, strong) NSString *path; @@ -30,9 +38,13 @@ NS_CLASS_AVAILABLE_IOS(11_0) @interface RCTPdfView : UIView #import @@ -26,6 +26,21 @@ #import #endif +#ifdef RCT_NEW_ARCH_ENABLED +#import +#import +#import +#import +#import + +// Some RN private method hacking below similar to how it is done in RNScreens: +// https://github.com/software-mansion/react-native-screens/blob/90e548739f35b5ded2524a9d6410033fc233f586/ios/RNSScreenStackHeaderConfig.mm#L30 +@interface RCTBridge (Private) ++ (RCTBridge *)currentBridge; +@end + +#endif + #ifndef __OPTIMIZE__ // only output log when debug #define DLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) @@ -39,7 +54,14 @@ const float MAX_SCALE = 3.0f; const float MIN_SCALE = 1.0f; -@implementation RCTPdfView +@interface RNPDFPdfView() +@end + +@implementation RNPDFPdfView { RCTBridge *_bridge; PDFDocument *_pdfDocument; @@ -48,64 +70,242 @@ @implementation RCTPdfView float _fixScaleFactor; bool _initialed; NSArray *_changedProps; + UITapGestureRecognizer *_doubleTapRecognizer; + UITapGestureRecognizer *_singleTapRecognizer; + UIPinchGestureRecognizer *_pinchRecognizer; + UILongPressGestureRecognizer *_longPressRecognizer; + UITapGestureRecognizer *_doubleTapEmptyRecognizer; } -- (instancetype)initWithBridge:(RCTBridge *)bridge +#ifdef RCT_NEW_ARCH_ENABLED + +using namespace facebook::react; + ++ (ComponentDescriptorProvider)componentDescriptorProvider { - self = [super init]; - if (self) { + return concreteComponentDescriptorProvider(); +} - _bridge = bridge; - _page = 1; - _scale = 1; - _minScale = MIN_SCALE; - _maxScale = MAX_SCALE; - _horizontal = NO; - _enablePaging = NO; - _enableRTL = NO; - _enableAnnotationRendering = YES; - _fitPolicy = 2; - _spacing = 10; - _singlePage = NO; - - // init and config PDFView - _pdfView = [[PDFView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)]; - _pdfView.displayMode = kPDFDisplaySinglePageContinuous; - _pdfView.autoScales = YES; - _pdfView.displaysPageBreaks = YES; - _pdfView.displayBox = kPDFDisplayBoxCropBox; - _pdfView.backgroundColor = [UIColor clearColor]; +// Needed because of this: https://github.com/facebook/react-native/pull/37274 ++ (void)load +{ + [super load]; +} - _fixScaleFactor = -1.0f; - _initialed = NO; - _changedProps = NULL; +- (instancetype)initWithFrame:(CGRect)frame +{ + if (self = [super initWithFrame:frame]) { + static const auto defaultProps = std::make_shared(); + _props = defaultProps; + [self initCommonProps]; + } + return self; +} - [self addSubview:_pdfView]; +- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps +{ + const auto &newProps = *std::static_pointer_cast(props); + NSMutableArray *updatedPropNames = [NSMutableArray new]; + if (_path != RCTNSStringFromStringNilIfEmpty(newProps.path)) { + _path = RCTNSStringFromStringNilIfEmpty(newProps.path); + [updatedPropNames addObject:@"path"]; + } + if (_page != newProps.page) { + _page = newProps.page; + [updatedPropNames addObject:@"page"]; + } + if (_scale != newProps.scale) { + _scale = newProps.scale; + [updatedPropNames addObject:@"scale"]; + } + if (_minScale != newProps.minScale) { + _minScale = newProps.minScale; + [updatedPropNames addObject:@"minScale"]; + } + if (_maxScale != newProps.maxScale) { + _maxScale = newProps.maxScale; + [updatedPropNames addObject:@"maxScale"]; + } + if (_horizontal != newProps.horizontal) { + _horizontal = newProps.horizontal; + [updatedPropNames addObject:@"horizontal"]; + } + if (_enablePaging != newProps.enablePaging) { + _enablePaging = newProps.enablePaging; + [updatedPropNames addObject:@"enablePaging"]; + } + if (_enableRTL != newProps.enableRTL) { + _enableRTL = newProps.enableRTL; + [updatedPropNames addObject:@"enableRTL"]; + } + if (_enableAnnotationRendering != newProps.enableAnnotationRendering) { + _enableAnnotationRendering = newProps.enableAnnotationRendering; + [updatedPropNames addObject:@"enableAnnotationRendering"]; + } + if (_enableDoubleTapZoom != newProps.enableDoubleTapZoom) { + _enableDoubleTapZoom = newProps.enableDoubleTapZoom; + [updatedPropNames addObject:@"enableDoubleTapZoom"]; + } + if (_fitPolicy != newProps.fitPolicy) { + _fitPolicy = newProps.fitPolicy; + [updatedPropNames addObject:@"fitPolicy"]; + } + if (_spacing != newProps.spacing) { + _spacing = newProps.spacing; + [updatedPropNames addObject:@"spacing"]; + } + if (_password != RCTNSStringFromStringNilIfEmpty(newProps.password)) { + _password = RCTNSStringFromStringNilIfEmpty(newProps.password); + [updatedPropNames addObject:@"password"]; + } + if (_singlePage != newProps.singlePage) { + _singlePage = newProps.singlePage; + [updatedPropNames addObject:@"singlePage"]; + } + if (_showsHorizontalScrollIndicator != newProps.showsHorizontalScrollIndicator) { + _showsHorizontalScrollIndicator = newProps.showsHorizontalScrollIndicator; + [updatedPropNames addObject:@"showsHorizontalScrollIndicator"]; + } + if (_showsVerticalScrollIndicator != newProps.showsVerticalScrollIndicator) { + _showsVerticalScrollIndicator = newProps.showsVerticalScrollIndicator; + [updatedPropNames addObject:@"showsVerticalScrollIndicator"]; + } + + if (_scrollEnabled != newProps.scrollEnabled) { + _scrollEnabled = newProps.scrollEnabled; + [updatedPropNames addObject:@"scrollEnabled"]; + } + + [super updateProps:props oldProps:oldProps]; + [self didSetProps:updatedPropNames]; +} + +// already added in case https://github.com/facebook/react-native/pull/35378 has been merged +- (BOOL)shouldBeRecycled +{ + return NO; +} + +- (void)prepareForRecycle +{ + [super prepareForRecycle]; + + [_pdfView removeFromSuperview]; + _pdfDocument = Nil; + _pdfView = Nil; + //Remove notifications + [[NSNotificationCenter defaultCenter] removeObserver:self name:@"PDFViewDocumentChangedNotification" object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:@"PDFViewPageChangedNotification" object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:@"PDFViewScaleChangedNotification" object:nil]; + + // remove old recognizers before adding new ones + [self removeGestureRecognizer:_doubleTapRecognizer]; + [self removeGestureRecognizer:_singleTapRecognizer]; + [self removeGestureRecognizer:_pinchRecognizer]; + [self removeGestureRecognizer:_longPressRecognizer]; + [self removeGestureRecognizer:_doubleTapEmptyRecognizer]; + + [self initCommonProps]; +} + +- (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics +{ + // Fabric equivalent of `reactSetFrame` method + [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics]; + _pdfView.frame = CGRectMake(0, 0, layoutMetrics.frame.size.width, layoutMetrics.frame.size.height); + + NSMutableArray *mProps = [_changedProps mutableCopy]; + if (_initialed) { + [mProps removeObject:@"path"]; + } + _initialed = YES; + [self didSetProps:mProps]; +} - // register notification - NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; - [center addObserver:self selector:@selector(onDocumentChanged:) name:PDFViewDocumentChangedNotification object:_pdfView]; - [center addObserver:self selector:@selector(onPageChanged:) name:PDFViewPageChangedNotification object:_pdfView]; - [center addObserver:self selector:@selector(onScaleChanged:) name:PDFViewScaleChangedNotification object:_pdfView]; +- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args +{ + RCTRNPDFPdfViewHandleCommand(self, commandName, args); +} - [[_pdfView document] setDelegate: self]; - [_pdfView setDelegate: self]; +- (void)setNativePage:(NSInteger)page +{ + _page = page; + [self didSetProps:[NSArray arrayWithObject:@"page"]]; +} +#endif - [self bindTap]; +- (instancetype)initWithBridge:(RCTBridge *)bridge +{ + self = [super init]; + if (self) { + _bridge = bridge; + [self initCommonProps]; } return self; } +- (void)initCommonProps +{ + _page = 1; + _scale = 1; + _minScale = MIN_SCALE; + _maxScale = MAX_SCALE; + _horizontal = NO; + _enablePaging = NO; + _enableRTL = NO; + _enableAnnotationRendering = YES; + _enableDoubleTapZoom = YES; + _fitPolicy = 2; + _spacing = 10; + _singlePage = NO; + _showsHorizontalScrollIndicator = YES; + _showsVerticalScrollIndicator = YES; + _scrollEnabled = YES; + + // init and config PDFView + _pdfView = [[PDFView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)]; + _pdfView.displayMode = kPDFDisplaySinglePageContinuous; + _pdfView.autoScales = YES; + _pdfView.displaysPageBreaks = YES; + _pdfView.displayBox = kPDFDisplayBoxCropBox; + _pdfView.backgroundColor = [UIColor clearColor]; + + _fixScaleFactor = -1.0f; + _initialed = NO; + _changedProps = NULL; + + [self addSubview:_pdfView]; + + + // register notification + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + [center addObserver:self selector:@selector(onDocumentChanged:) name:PDFViewDocumentChangedNotification object:_pdfView]; + [center addObserver:self selector:@selector(onPageChanged:) name:PDFViewPageChangedNotification object:_pdfView]; + [center addObserver:self selector:@selector(onScaleChanged:) name:PDFViewScaleChangedNotification object:_pdfView]; + + [[_pdfView document] setDelegate: self]; + [_pdfView setDelegate: self]; + + // Disable built-in double tap, so as not to conflict with custom recognizers. + for (UIGestureRecognizer *recognizer in _pdfView.gestureRecognizers) { + if ([recognizer isKindOfClass:[UITapGestureRecognizer class]]) { + recognizer.enabled = NO; + } + } + + [self bindTap]; +} + - (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)url { NSString *_url = url.absoluteString; - _onChange(@{ @"message": + [self notifyOnChangeWithMessage: [[NSString alloc] initWithString: [NSString stringWithFormat: - @"linkPressed|%s", _url.UTF8String]] }); + @"linkPressed|%s", _url.UTF8String]]]; } - (void)didSetProps:(NSArray *)changedProps @@ -125,13 +325,22 @@ - (void)didSetProps:(NSArray *)changedProps } if ([_path hasPrefix:@"blob:"]) { - RCTBlobManager *blobManager = [_bridge moduleForName:@"BlobModule"]; + RCTBlobManager *blobManager = [ +#ifdef RCT_NEW_ARCH_ENABLED + [RCTBridge currentBridge] +#else + _bridge +#endif // RCT_NEW_ARCH_ENABLED + moduleForName:@"BlobModule"]; NSURL *blobURL = [NSURL URLWithString:_path]; NSData *blobData = [blobManager resolveURL:blobURL]; if (blobData != nil) { _pdfDocument = [[PDFDocument alloc] initWithData:blobData]; } } else { + + // decode file path + _path = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)_path, CFSTR("")); NSURL *fileURL = [NSURL fileURLWithPath:_path]; _pdfDocument = [[PDFDocument alloc] initWithURL:fileURL]; } @@ -141,7 +350,7 @@ - (void)didSetProps:(NSArray *)changedProps //check need password or not if (_pdfDocument.isLocked && ![_pdfDocument unlockWithPassword:_password]) { - _onChange(@{ @"message": @"error|Password required or incorrect password."}); + [self notifyOnChangeWithMessage:@"error|Password required or incorrect password."]; _pdfDocument = Nil; return; @@ -150,7 +359,7 @@ - (void)didSetProps:(NSArray *)changedProps _pdfView.document = _pdfDocument; } else { - _onChange(@{ @"message": [[NSString alloc] initWithString:[NSString stringWithFormat:@"error|Load pdf failed. path=%s",_path.UTF8String]]}); + [self notifyOnChangeWithMessage:[[NSString alloc] initWithString:[NSString stringWithFormat:@"error|Load pdf failed. path=%s",_path.UTF8String]]]; _pdfDocument = Nil; return; @@ -200,7 +409,7 @@ - (void)didSetProps:(NSArray *)changedProps if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"fitPolicy"] || [changedProps containsObject:@"minScale"] || [changedProps containsObject:@"maxScale"])) { - PDFPage *pdfPage = [_pdfDocument pageAtIndex:_pdfDocument.pageCount-1]; + PDFPage *pdfPage = _pdfView.currentPage ? _pdfView.currentPage : [_pdfDocument pageAtIndex:_pdfDocument.pageCount-1]; CGRect pdfPageRect = [pdfPage boundsForBox:kPDFDisplayBoxCropBox]; // some pdf with rotation, then adjust it @@ -270,10 +479,41 @@ - (void)didSetProps:(NSArray *)changedProps } } + if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"showsHorizontalScrollIndicator"] || [changedProps containsObject:@"showsVerticalScrollIndicator"])) { + [self setScrollIndicators:self horizontal:_showsHorizontalScrollIndicator vertical:_showsVerticalScrollIndicator depth:0]; + } + + if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"scrollEnabled"])) { + if (_scrollEnabled) { + for (UIView *subview in _pdfView.subviews) { + if ([subview isKindOfClass:[UIScrollView class]]) { + UIScrollView *scrollView = (UIScrollView *)subview; + scrollView.scrollEnabled = YES; + } + } + } else { + for (UIView *subview in _pdfView.subviews) { + if ([subview isKindOfClass:[UIScrollView class]]) { + UIScrollView *scrollView = (UIScrollView *)subview; + scrollView.scrollEnabled = NO; + } + } + } + } + if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"enablePaging"] || [changedProps containsObject:@"horizontal"] || [changedProps containsObject:@"page"])) { PDFPage *pdfPage = [_pdfDocument pageAtIndex:_page-1]; - if (pdfPage) { + if (pdfPage && _page == 1) { + // goToDestination() would be better. However, there is an + // error in the pointLeftTop computation that often results in + // scrolling to the middle of the page. + // Special case workaround to make starting at the first page + // align acceptably. + dispatch_async(dispatch_get_main_queue(), ^{ + [self->_pdfView goToRect:CGRectMake(0, NSUIntegerMax, 1, 1) onPage:pdfPage]; + }); + } else if (pdfPage) { CGRect pdfPageRect = [pdfPage boundsForBox:kPDFDisplayBoxCropBox]; // some pdf with rotation, then adjust it @@ -309,6 +549,19 @@ - (void)reactSetFrame:(CGRect)frame [self didSetProps:mProps]; } + +- (void)notifyOnChangeWithMessage:(NSString *)message +{ +#ifdef RCT_NEW_ARCH_ENABLED + if (_eventEmitter != nullptr) { + std::dynamic_pointer_cast(_eventEmitter) + ->onChange(RNPDFPdfViewEventEmitter::OnChange{.message = RCTStringFromNSString(message)}); + } +#else + _onChange(@{ @"message": message}); +#endif +} + - (void)dealloc{ _pdfDocument = Nil; @@ -319,6 +572,11 @@ - (void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self name:@"PDFViewPageChangedNotification" object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:@"PDFViewScaleChangedNotification" object:nil]; + _doubleTapRecognizer = nil; + _singleTapRecognizer = nil; + _pinchRecognizer = nil; + _longPressRecognizer = nil; + _doubleTapEmptyRecognizer = nil; } #pragma mark notification process @@ -332,7 +590,8 @@ - (void)onDocumentChanged:(NSNotification *)noti CGSize pageSize = [_pdfView rowSizeForPage:page]; NSString *jsonString = [self getTableContents]; - _onChange(@{ @"message": [[NSString alloc] initWithString:[NSString stringWithFormat:@"loadComplete|%lu|%f|%f|%@", numberOfPages, pageSize.width, pageSize.height,jsonString]]}); + [self notifyOnChangeWithMessage: + [[NSString alloc] initWithString:[NSString stringWithFormat:@"loadComplete|%lu|%f|%f|%@", numberOfPages, pageSize.width, pageSize.height,jsonString]]]; } } @@ -431,7 +690,7 @@ - (void)onPageChanged:(NSNotification *)noti unsigned long page = [_pdfDocument indexForPage:currentPage]; unsigned long numberOfPages = _pdfDocument.pageCount; - _onChange(@{ @"message": [[NSString alloc] initWithString:[NSString stringWithFormat:@"pageChanged|%lu|%lu", page+1, numberOfPages]]}); + [self notifyOnChangeWithMessage:[[NSString alloc] initWithString:[NSString stringWithFormat:@"pageChanged|%lu|%lu", page+1, numberOfPages]]]; } } @@ -442,13 +701,20 @@ - (void)onScaleChanged:(NSNotification *)noti if (_initialed && _fixScaleFactor>0) { if (_scale != _pdfView.scaleFactor/_fixScaleFactor) { _scale = _pdfView.scaleFactor/_fixScaleFactor; - _onChange(@{ @"message": [[NSString alloc] initWithString:[NSString stringWithFormat:@"scaleChanged|%f", _scale]]}); + [self notifyOnChangeWithMessage:[[NSString alloc] initWithString:[NSString stringWithFormat:@"scaleChanged|%f", _scale]]]; } } } #pragma mark gesture process +/** + * Empty double tap handler + * + * + */ +- (void)handleDoubleTapEmpty:(UITapGestureRecognizer *)recognizer {} + /** * Tap * zoom reset or zoom in @@ -457,6 +723,19 @@ - (void)onScaleChanged:(NSNotification *)noti */ - (void)handleDoubleTap:(UITapGestureRecognizer *)recognizer { + + // Prevent double tap from selecting text. + dispatch_async(dispatch_get_main_queue(), ^{ + [self->_pdfView clearSelection]; + }); + + // Event appears to be consumed; broadcast for JS. + // _onChange(@{ @"message": @"pageDoubleTap" }); + + if (!_enableDoubleTapZoom) { + return; + } + // Cycle through min/mid/max scale factors to be consistent with Android float min = self->_pdfView.minScaleFactor/self->_fixScaleFactor; float max = self->_pdfView.maxScaleFactor/self->_fixScaleFactor; @@ -472,17 +751,36 @@ - (void)handleDoubleTap:(UITapGestureRecognizer *)recognizer CGFloat newScale = scale * self->_fixScaleFactor; CGPoint tapPoint = [recognizer locationInView:self->_pdfView]; - tapPoint = [self->_pdfView convertPoint:tapPoint toPage:self->_pdfView.currentPage]; - CGRect zoomRect = CGRectZero; - zoomRect.size.width = self->_pdfView.frame.size.width * newScale; - zoomRect.size.height = self->_pdfView.frame.size.height * newScale; - zoomRect.origin.x = tapPoint.x - zoomRect.size.width / 2; - zoomRect.origin.y = tapPoint.y - zoomRect.size.height / 2; + + PDFPage *tappedPdfPage = [_pdfView pageForPoint:tapPoint nearest:NO]; + PDFPage *pageRef; + if (tappedPdfPage) { + pageRef = tappedPdfPage; + } else { + pageRef = self->_pdfView.currentPage; + } + tapPoint = [self->_pdfView convertPoint:tapPoint toPage:pageRef]; + + CGRect tempZoomRect = CGRectZero; + tempZoomRect.size.width = self->_pdfView.frame.size.width; + tempZoomRect.size.height = 1; + tempZoomRect.origin = tapPoint; dispatch_async(dispatch_get_main_queue(), ^{ [UIView animateWithDuration:0.3 animations:^{ [self->_pdfView setScaleFactor:newScale]; - [self->_pdfView goToRect:zoomRect onPage:self->_pdfView.currentPage]; + + [self->_pdfView goToRect:tempZoomRect onPage:pageRef]; + CGPoint defZoomOrigin = [self->_pdfView convertPoint:tempZoomRect.origin fromPage:pageRef]; + defZoomOrigin.x = defZoomOrigin.x - self->_pdfView.frame.size.width / 2; + defZoomOrigin.y = defZoomOrigin.y - self->_pdfView.frame.size.height / 2; + defZoomOrigin = [self->_pdfView convertPoint:defZoomOrigin toPage:pageRef]; + CGRect defZoomRect = CGRectOffset( + tempZoomRect, + defZoomOrigin.x - tempZoomRect.origin.x, + defZoomOrigin.y - tempZoomRect.origin.y + ); + [self->_pdfView goToRect:defZoomRect onPage:pageRef]; [self setNeedsDisplay]; [self onScaleChanged:Nil]; @@ -504,7 +802,8 @@ - (void)handleSingleTap:(UITapGestureRecognizer *)sender PDFPage *pdfPage = [_pdfView pageForPoint:point nearest:NO]; if (pdfPage) { unsigned long page = [_pdfDocument indexForPage:pdfPage]; - _onChange(@{ @"message": [[NSString alloc] initWithString:[NSString stringWithFormat:@"pageSingleTap|%lu|%f|%f", page+1, point.x, point.y]]}); + [self notifyOnChangeWithMessage: + [[NSString alloc] initWithString:[NSString stringWithFormat:@"pageSingleTap|%lu|%f|%f", page+1, point.x, point.y]]]; } //[self setNeedsDisplay]; @@ -547,6 +846,7 @@ - (void)bindTap doubleTapRecognizer.delegate = self; [self addGestureRecognizer:doubleTapRecognizer]; + _doubleTapRecognizer = doubleTapRecognizer; UITapGestureRecognizer *singleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; @@ -556,11 +856,15 @@ - (void)bindTap singleTapRecognizer.delegate = self; [self addGestureRecognizer:singleTapRecognizer]; + _singleTapRecognizer = singleTapRecognizer; + [singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer]; UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)]; [self addGestureRecognizer:pinchRecognizer]; + _pinchRecognizer = pinchRecognizer; + pinchRecognizer.delegate = self; UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self @@ -571,7 +875,14 @@ - (void)bindTap longPressRecognizer.minimumPressDuration=0.3; [self addGestureRecognizer:longPressRecognizer]; - + _longPressRecognizer = longPressRecognizer; + + // Override the _pdfView double tap gesture recognizer so that it doesn't confilict with custom double tap + UITapGestureRecognizer *doubleTapEmptyRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleDoubleTapEmpty:)]; + doubleTapEmptyRecognizer.numberOfTapsRequired = 2; + [_pdfView addGestureRecognizer:doubleTapEmptyRecognizer]; + _doubleTapEmptyRecognizer = doubleTapEmptyRecognizer; } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer @@ -585,6 +896,29 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni return !_singlePage; } - +- (void)setScrollIndicators:(UIView *)view horizontal:(BOOL)horizontal vertical:(BOOL)vertical depth:(int)depth { + // max depth, prevent infinite loop + if (depth > 10) { + return; + } + + if ([view isKindOfClass:[UIScrollView class]]) { + UIScrollView *scrollView = (UIScrollView *)view; + scrollView.showsHorizontalScrollIndicator = horizontal; + scrollView.showsVerticalScrollIndicator = vertical; + } + + for (UIView *subview in view.subviews) { + [self setScrollIndicators:subview horizontal:horizontal vertical:vertical depth:depth + 1]; + } +} @end + +#ifdef RCT_NEW_ARCH_ENABLED +Class RNPDFPdfViewCls(void) +{ + return RNPDFPdfView.class; +} + +#endif diff --git a/ios/RCTPdf/RCTPdfViewManager.h b/ios/RNPDFPdf/RNPDFPdfViewManager.h similarity index 87% rename from ios/RCTPdf/RCTPdfViewManager.h rename to ios/RNPDFPdf/RNPDFPdfViewManager.h index ba9e0340..00506800 100644 --- a/ios/RCTPdf/RCTPdfViewManager.h +++ b/ios/RNPDFPdf/RNPDFPdfViewManager.h @@ -13,6 +13,6 @@ #endif -@interface RCTPdfViewManager : RCTViewManager +@interface RNPDFPdfViewManager : RCTViewManager @end diff --git a/ios/RCTPdf/RCTPdfViewManager.m b/ios/RNPDFPdf/RNPDFPdfViewManager.mm similarity index 80% rename from ios/RCTPdf/RCTPdfViewManager.m rename to ios/RNPDFPdf/RNPDFPdfViewManager.mm index 9f56c674..f58f7e6d 100644 --- a/ios/RCTPdf/RCTPdfViewManager.m +++ b/ios/RNPDFPdf/RNPDFPdfViewManager.mm @@ -8,11 +8,11 @@ #import -#import "RCTPdfViewManager.h" -#import "RCTPdfView.h" +#import "RNPDFPdfViewManager.h" +#import "RNPDFPdfView.h" -@implementation RCTPdfViewManager +@implementation RNPDFPdfViewManager RCT_EXPORT_MODULE() @@ -20,7 +20,7 @@ - (UIView *)view { if([[[UIDevice currentDevice] systemVersion] compare:@"11.0" options:NSNumericSearch] == NSOrderedDescending || [[[UIDevice currentDevice] systemVersion] compare:@"11.0" options:NSNumericSearch] == NSOrderedSame) { - return [[RCTPdfView alloc] initWithBridge:self.bridge]; + return [[RNPDFPdfView alloc] initWithBridge:self.bridge]; } else { return NULL; } @@ -33,9 +33,13 @@ - (UIView *)view RCT_EXPORT_VIEW_PROPERTY(minScale, float); RCT_EXPORT_VIEW_PROPERTY(maxScale, float); RCT_EXPORT_VIEW_PROPERTY(horizontal, BOOL); +RCT_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator, BOOL); +RCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL); +RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL); RCT_EXPORT_VIEW_PROPERTY(enablePaging, BOOL); RCT_EXPORT_VIEW_PROPERTY(enableRTL, BOOL); RCT_EXPORT_VIEW_PROPERTY(enableAnnotationRendering, BOOL); +RCT_EXPORT_VIEW_PROPERTY(enableDoubleTapZoom, BOOL); RCT_EXPORT_VIEW_PROPERTY(fitPolicy, int); RCT_EXPORT_VIEW_PROPERTY(spacing, int); RCT_EXPORT_VIEW_PROPERTY(password, NSString); @@ -61,4 +65,4 @@ + (BOOL)requiresMainQueueSetup { - (void)dealloc{ } -@end \ No newline at end of file +@end diff --git a/issue_template.md b/issue_template.md deleted file mode 100644 index 009b8c95..00000000 --- a/issue_template.md +++ /dev/null @@ -1,13 +0,0 @@ -What `react-native` version are you using? - -What `react-native-pdf` version are you using? - -What platform does your issue occur on? (android/ios/both) - -Describe your issue as precisely as possible : - 1) Steps to reproduce the issue or to explain in which case you get the issue - 2) Interesting `logs` - -Join a screenshot or video of the problem on the simulator or device? - -Show us the code you are using? diff --git a/package.json b/package.json index 11c41a4f..7fb18b7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-pdf", - "version": "6.5.0", + "version": "6.7.7", "summary": "A react native PDF view component", "description": "A react native PDF view component, support ios and android platform", "main": "index.js", @@ -28,11 +28,19 @@ "url": "https://github.com/wonday/react-native-pdf/issues" }, "dependencies": { - "crypto-js": "^3.2.0" + "crypto-js": "4.2.0", + "deprecated-react-native-prop-types": "^2.3.0" }, "devDependencies": { + "@babel/core": "^7.20.2", + "@babel/runtime": "^7.20.1", "prop-types": "^15.7.2" }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-blob-util": ">=0.13.7" + }, "files": [ "android/", "ios/", @@ -46,6 +54,15 @@ "PdfView.js", "PdfViewFlatList.js", "PinchZoomView.js", - "react-native-pdf.podspec" - ] + "react-native-pdf.podspec", + "fabric/" + ], + "codegenConfig": { + "name": "rnpdf", + "type": "components", + "jsSrcsDir": "./fabric", + "android": { + "javaPackageName": "org.wonday.pdf" + } + } } diff --git a/react-native-pdf.podspec b/react-native-pdf.podspec index 9e2e27ba..329d4904 100644 --- a/react-native-pdf.podspec +++ b/react-native-pdf.podspec @@ -2,6 +2,8 @@ require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) +fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' + Pod::Spec.new do |s| s.name = package['name'] s.version = package['version'] @@ -12,7 +14,17 @@ Pod::Spec.new do |s| s.homepage = package['homepage'] s.source = { :git => 'https://github.com/wonday/react-native-pdf.git', :tag => "v#{s.version}" } s.requires_arc = true - s.platform = :ios, '8.0' - s.source_files = 'ios/**/*.{h,m}' - s.dependency 'React-Core' + s.framework = "PDFKit" + + if fabric_enabled + s.platforms = { ios: '11.0', tvos: '11.0' } + s.source_files = 'ios/**/*.{h,m,mm,cpp}' + s.requires_arc = true + install_modules_dependencies(s) + + else + s.platform = :ios, '8.0' + s.source_files = 'ios/**/*.{h,m,mm}' + s.dependency 'React-Core' + end end diff --git a/windows/RCTPdf/pch.h b/windows/RCTPdf/pch.h index cc639a98..38280d66 100644 --- a/windows/RCTPdf/pch.h +++ b/windows/RCTPdf/pch.h @@ -26,4 +26,6 @@ #include #include #include +#include +#include #include