App.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  3. *
  4. * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  5. * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  6. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  7. * This notice may not be removed from this file.
  8. */
  9. import React, { Component } from 'react';
  10. import { Platform } from 'react-native';
  11. import { ComPDFKit } from '@compdfkit_pdf_sdk/react_native';
  12. import HomeScreen from './src/screens/HomeScreen';
  13. import { NavigationContainer } from '@react-navigation/native';
  14. import { createNativeStackNavigator } from '@react-navigation/native-stack';
  15. import CPDFReaderViewExampleScreen from './src/screens/CPDFReaderViewExampleScreen';
  16. const Stack = createNativeStackNavigator();
  17. type Props = {};
  18. export default class App extends Component<Props> {
  19. constructor(props: Props) {
  20. super(props)
  21. this.initialize()
  22. }
  23. async initialize() {
  24. // Online certification, Fill in your online license
  25. // Returns true if initialization is successful, otherwise returns false.
  26. // var result = await ComPDFKit.initialize('NjYzODcyYTMxOWQzMA==', 'NjYzODcyYTgxM2YwNg==')
  27. // console.log("ComPDFKitRN", "initialize:", result)
  28. // Offline authentication, Fill in your offline license
  29. var result = await ComPDFKit.init_('jkqgDbjmu/wZnFWVRjEjvZ97oJE65uEurW3WqNaVyhFj1HXmeFsxUATQn4p0HYABrjJkvsZ8lbP1w/h/XpNuEHBYscDEUOdJO4wvY9/rKRb6Cizo1016AAzPEkY5m9l+nF4sfx1xf6VTCjhBEwHjo8uu+804VbZSIskn58mcHg0RcsydGYfQyYGf2ec7ZgSRa6Af+rd7De833kbPx2XI8G1YtXCltFfuQSXgYhE48o8BrAIwRLUMxXtMiVvzOBsR7YpYWNmZopopr5Gl9bLsvOK/VNDzHxGaDUg3CspTydlcJqangWZwi/i/SAdyHAVEZDmx8yshp4ts7fM2ore1m2u0lH1oY17eVN2TRW5amzqSj1QR5Q0MX/v2nFNCjvJImeroTsMiyvSO5KjU5Zrs50NckPDhF4Jmjsjb0LXK/bRpxkkuyEYFaz4564aaZEovVo8qwJUkIDPadcRz3j1bMwrqiQMhyGL/CLyGlIiYGkjTdTyNMMHpYPUwPldrVMX4inb9KYdgJggKiH4aXNda34I5yuEfzFxlh8twdPhV7TyiUlFC5mg1ZXVW4rENlJxGheVfNI+5KOfueczv6umprFKusrOsv3g1BSw+mmRndsOcha/6QKMJHwnrDE1N2OTENH0a2YGMI+IdylVlk9Belz0e7qXSW2p6XVnGIzVa12xNGYjQV4tC0mUG8KeUljNpyqd6jdpA0bccj7S1aoN5ky53LuaWx/EZdW9UM3uuB/gJwbizOgM1HWwN4k+xh/zqL3M8AoJo5yXAPiYfIQoS3E1LqRj/dyR3uQhMlfCCGsA=')
  30. console.log("ComPDFKitRN", "init_:", result)
  31. }
  32. render() {
  33. return (
  34. <NavigationContainer>
  35. <Stack.Navigator>
  36. <Stack.Screen name="Home" component={HomeScreen} options={{
  37. title: 'ComPDFKit PDF SDK for ReactNative',
  38. headerStyle: {
  39. backgroundColor: '#FAFCFF',
  40. },
  41. headerTitleStyle: { fontSize: 16 }
  42. }} />
  43. <Stack.Screen name='CPDFReaderViewExample' component={CPDFReaderViewExampleScreen} options={{
  44. headerShadowVisible: false,
  45. headerStyle: {
  46. backgroundColor: '#FAFCFF',
  47. },
  48. }} />
  49. </Stack.Navigator>
  50. </NavigationContainer>
  51. );
  52. }
  53. }