Skip to content

Commit 7e91b82

Browse files
author
PSPDFKit
committed
Release 2.4.1
1 parent b20a3c8 commit 7e91b82

34 files changed

+871
-1163
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
## Newest Release
22

3+
### 2.4.1 - 22 Nov 2022
4+
- Updates for PSPDFKit 12.0.1 for iOS.
5+
- Fixes Catalog example toolbar menu items not rendering. (#37368)
6+
- Fixes the Annotation Processing Catalog example. (#37534)
7+
8+
## Previous Releases
9+
310
### 2.4.0 - 25 Oct 2022
411

512
- Adds PDF generation from HTML, images and template. (#36736)
613
- Updates for PSPDFKit 8.4.1 for Android
714
- Updates for PSPDFKit 12.0 for iOS
815

9-
## Previous Releases
10-
1116
### 2.3.1 - 22 Jul 2022
1217

1318
- Updates for PSPDFKit 8.2.1 for Android. (#34430)
@@ -23,7 +28,7 @@
2328

2429
### 2.2.2 - 15 Mar 2022
2530

26-
- Adds image support to `PSKDFKit.present()` on Android. (#33312)
31+
- Adds image support to `PSPDFKit.present()` on Android. (#33312)
2732
- Adds a new **Save As** example to the Catalog example project. (#33376)
2833
- Updates for PSPDFKit 11.3.0 for iOS. (#33485)
2934
- Fixes React Native Annotation Processor API for Android. (#33189, #33302)

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "react-native-pspdfkit",
3-
"version": "2.4.0",
4-
"version": "2.3.1",
3+
"version": "2.4.1",
54
"description": "React Native PDF Library by PSPDFKit",
65
"keywords": [
76
"react native",

samples/Catalog/Catalog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Imports
1010
import React, { Component } from 'react';
1111
import { NavigationContainer } from '@react-navigation/native';
12-
import { createNativeStackNavigator } from '@react-navigation/native-stack';
12+
import { createStackNavigator } from '@react-navigation/stack';
1313

1414
import { PSPDFKitViewComponent } from './examples/PSPDFKitViewComponent';
1515
import { OpenImageDocument } from './examples/OpenImageDocument';
@@ -44,7 +44,7 @@ class Catalog extends Component {
4444
};
4545

4646
render() {
47-
const Stack = createNativeStackNavigator();
47+
const Stack = createStackNavigator();
4848

4949
return (
5050
<NavigationContainer>

samples/Catalog/android/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,32 @@ buildscript {
66
compileSdkVersion = 31
77
targetSdkVersion = 30
88
ndkVersion = "20.1.5948944"
9+
kotlin_version = '1.6.10' // <- add this line
910
}
1011
repositories {
1112
google()
1213
mavenCentral()
1314
}
1415
dependencies {
1516
classpath("com.android.tools.build:gradle:7.1.1")
17+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // <- add this line
1618
// NOTE: Do not place your application dependencies here; they belong
1719
// in the individual module build.gradle files
1820
}
1921
}
2022

2123
allprojects {
2224
repositories {
25+
exclusiveContent {
26+
filter {
27+
includeGroup "com.facebook.react"
28+
}
29+
forRepository {
30+
maven {
31+
url "$rootDir/../node_modules/react-native/android"
32+
}
33+
}
34+
}
2335
mavenLocal()
2436
mavenCentral()
2537
maven {

samples/Catalog/examples/AnnotationProcessing.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
1717
super(props);
1818
const { navigation } = this.props;
1919
this.pdfRef = React.createRef();
20-
2120
hideToolbar(navigation);
22-
23-
navigation.addListener('beforeRemove', e => {
24-
this.pdfRef?.current?.destroyView();
25-
});
26-
}
27-
28-
componentWillUnmount() {
29-
const { navigation } = this.props;
30-
navigation.removeListener('beforeRemove');
3121
}
3222

3323
render() {
@@ -59,7 +49,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
5949
})
6050
// First, save all annotations in the current document.
6151
.then(() => {
62-
this.refs.pdfView
52+
this.pdfRef.current
6353
.saveCurrentDocument()
6454
.then(saved => {
6555
// Then, embed all the annotations
@@ -104,7 +94,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
10494
})
10595
.then(() => {
10696
// First, save all annotations in the current document.
107-
this.refs.pdfView
97+
this.pdfRef.current
10898
.saveCurrentDocument()
10999
.then(saved => {
110100
// Then, flatten all the annotations
@@ -151,7 +141,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
151141
})
152142
.then(() => {
153143
// First, save all annotations in the current document.
154-
this.refs.pdfView
144+
this.pdfRef.current
155145
.saveCurrentDocument()
156146
.then(saved => {
157147
// Then, remove all the annotations
@@ -196,7 +186,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
196186
})
197187
.then(() => {
198188
// First, save all annotations in the current document.
199-
this.refs.pdfView
189+
this.pdfRef.current
200190
.saveCurrentDocument()
201191
.then(success => {
202192
// Then, print all the annotations

samples/Catalog/examples/CustomFontPicker.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ export class CustomFontPicker extends BaseExampleAutoHidingHeaderComponent {
1414
this.pdfRef = React.createRef();
1515

1616
hideToolbar(navigation);
17-
18-
navigation.addListener('beforeRemove', e => {
19-
this.pdfRef?.current?.destroyView();
20-
});
21-
}
22-
23-
componentWillUnmount() {
24-
const { navigation } = this.props;
25-
navigation.removeListener('beforeRemove');
2617
}
2718

2819
render() {

samples/Catalog/examples/EventListeners.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,8 @@ export class EventListeners extends BaseExampleAutoHidingHeaderComponent {
1414
this.pdfRef = React.createRef();
1515

1616
hideToolbar(navigation);
17-
18-
navigation.addListener('beforeRemove', e => {
19-
this.pdfRef?.current?.destroyView();
20-
});
2117
}
2218

23-
componentWillUnmount() {
24-
const { navigation } = this.props;
25-
navigation.removeListener('beforeRemove');
26-
}
2719
render() {
2820
return (
2921
<View style={styles.flex}>

samples/Catalog/examples/GeneratePDF.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,13 @@ import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAuto
33
import { processColor, View } from 'react-native';
44
import PSPDFKitView from 'react-native-pspdfkit';
55
import { pspdfkitColor } from '../configuration/Constants';
6-
import { hideToolbar } from '../helpers/NavigationHelper';
76

87
export class GeneratePDF extends BaseExampleAutoHidingHeaderComponent {
98
pdfRef = null;
109

1110
constructor(props) {
1211
super(props);
13-
const { navigation } = this.props;
1412
this.pdfRef = React.createRef();
15-
16-
navigation.addListener('beforeRemove', e => {
17-
this.pdfRef?.current?.destroyView();
18-
});
19-
}
20-
21-
componentWillUnmount() {
22-
const { navigation } = this.props;
23-
navigation.removeListener('beforeRemove');
2413
}
2514

2615
render() {

samples/Catalog/examples/HiddenToolbar.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,8 @@ export class HiddenToolbar extends Component {
3535
};
3636
}
3737

38-
componentWillUnmount() {
39-
const { navigation } = this.props;
40-
navigation.removeListener('beforeRemove');
41-
}
42-
4338
componentDidMount() {
4439
const { navigation } = this.props;
45-
navigation.addListener('beforeRemove', e => {
46-
this.pdfRef?.current?.destroyView();
47-
});
48-
4940
navigation.setOptions({
5041
handleAnnotationButtonPress: () => {
5142
if (

samples/Catalog/examples/ManualSave.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,7 @@ export class ManualSave extends BaseExampleAutoHidingHeaderComponent {
1212

1313
constructor(props) {
1414
super(props);
15-
const { navigation } = this.props;
1615
this.pdfRef = React.createRef();
17-
18-
navigation.addListener('beforeRemove', e => {
19-
this.pdfRef?.current?.destroyView();
20-
});
21-
}
22-
23-
componentWillUnmount() {
24-
const { navigation } = this.props;
25-
navigation.removeListener('beforeRemove');
2616
}
2717

2818
render() {

0 commit comments

Comments
 (0)