Skip to content

Commit

Permalink
Release 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PSPDFKit committed Nov 22, 2022
1 parent b20a3c8 commit 7e91b82
Show file tree
Hide file tree
Showing 34 changed files with 871 additions and 1,163 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
## Newest Release

### 2.4.1 - 22 Nov 2022
- Updates for PSPDFKit 12.0.1 for iOS.
- Fixes Catalog example toolbar menu items not rendering. (#37368)
- Fixes the Annotation Processing Catalog example. (#37534)

## Previous Releases

### 2.4.0 - 25 Oct 2022

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

## Previous Releases

### 2.3.1 - 22 Jul 2022

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

### 2.2.2 - 15 Mar 2022

- Adds image support to `PSKDFKit.present()` on Android. (#33312)
- Adds image support to `PSPDFKit.present()` on Android. (#33312)
- Adds a new **Save As** example to the Catalog example project. (#33376)
- Updates for PSPDFKit 11.3.0 for iOS. (#33485)
- Fixes React Native Annotation Processor API for Android. (#33189, #33302)
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "2.4.0",
"version": "2.3.1",
"version": "2.4.1",
"description": "React Native PDF Library by PSPDFKit",
"keywords": [
"react native",
Expand Down
4 changes: 2 additions & 2 deletions samples/Catalog/Catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Imports
import React, { Component } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createStackNavigator } from '@react-navigation/stack';

import { PSPDFKitViewComponent } from './examples/PSPDFKitViewComponent';
import { OpenImageDocument } from './examples/OpenImageDocument';
Expand Down Expand Up @@ -44,7 +44,7 @@ class Catalog extends Component {
};

render() {
const Stack = createNativeStackNavigator();
const Stack = createStackNavigator();

return (
<NavigationContainer>
Expand Down
12 changes: 12 additions & 0 deletions samples/Catalog/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,32 @@ buildscript {
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
kotlin_version = '1.6.10' // <- add this line
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.1")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // <- add this line
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
exclusiveContent {
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
mavenLocal()
mavenCentral()
maven {
Expand Down
18 changes: 4 additions & 14 deletions samples/Catalog/examples/AnnotationProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();

hideToolbar(navigation);

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down Expand Up @@ -59,7 +49,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
})
// First, save all annotations in the current document.
.then(() => {
this.refs.pdfView
this.pdfRef.current
.saveCurrentDocument()
.then(saved => {
// Then, embed all the annotations
Expand Down Expand Up @@ -104,7 +94,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
})
.then(() => {
// First, save all annotations in the current document.
this.refs.pdfView
this.pdfRef.current
.saveCurrentDocument()
.then(saved => {
// Then, flatten all the annotations
Expand Down Expand Up @@ -151,7 +141,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
})
.then(() => {
// First, save all annotations in the current document.
this.refs.pdfView
this.pdfRef.current
.saveCurrentDocument()
.then(saved => {
// Then, remove all the annotations
Expand Down Expand Up @@ -196,7 +186,7 @@ export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
})
.then(() => {
// First, save all annotations in the current document.
this.refs.pdfView
this.pdfRef.current
.saveCurrentDocument()
.then(success => {
// Then, print all the annotations
Expand Down
9 changes: 0 additions & 9 deletions samples/Catalog/examples/CustomFontPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ export class CustomFontPicker extends BaseExampleAutoHidingHeaderComponent {
this.pdfRef = React.createRef();

hideToolbar(navigation);

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
8 changes: 0 additions & 8 deletions samples/Catalog/examples/EventListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ export class EventListeners extends BaseExampleAutoHidingHeaderComponent {
this.pdfRef = React.createRef();

hideToolbar(navigation);

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}
render() {
return (
<View style={styles.flex}>
Expand Down
11 changes: 0 additions & 11 deletions samples/Catalog/examples/GeneratePDF.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,13 @@ import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAuto
import { processColor, View } from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit';
import { pspdfkitColor } from '../configuration/Constants';
import { hideToolbar } from '../helpers/NavigationHelper';

export class GeneratePDF extends BaseExampleAutoHidingHeaderComponent {
pdfRef = null;

constructor(props) {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
9 changes: 0 additions & 9 deletions samples/Catalog/examples/HiddenToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,8 @@ export class HiddenToolbar extends Component {
};
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

componentDidMount() {
const { navigation } = this.props;
navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});

navigation.setOptions({
handleAnnotationButtonPress: () => {
if (
Expand Down
10 changes: 0 additions & 10 deletions samples/Catalog/examples/ManualSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ export class ManualSave extends BaseExampleAutoHidingHeaderComponent {

constructor(props) {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
8 changes: 0 additions & 8 deletions samples/Catalog/examples/OpenImageDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ export class OpenImageDocument extends BaseExampleAutoHidingHeaderComponent {
this.pdfRef = React.createRef();

hideToolbar(navigation);

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}
render() {
return (
<View style={styles.flex}>
Expand Down
9 changes: 0 additions & 9 deletions samples/Catalog/examples/PSPDFKitViewComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ export class PSPDFKitViewComponent extends BaseExampleAutoHidingHeaderComponent
this.pdfRef = React.createRef();

hideToolbar(navigation);

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
13 changes: 1 addition & 12 deletions samples/Catalog/examples/ProgrammaticAnnotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,7 @@ export class ProgrammaticAnnotations extends BaseExampleAutoHidingHeaderComponen
};
}

pdfRef = null;
componentDidMount() {
const { navigation } = this.props;
navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}
// pdfRef = null;

render() {
return (
Expand Down
9 changes: 0 additions & 9 deletions samples/Catalog/examples/ProgrammaticFormFilling.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,9 @@ export class ProgrammaticFormFilling extends BaseExampleAutoHidingHeaderComponen

constructor(props) {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}
render() {
return (
<View style={styles.flex}>
Expand Down
10 changes: 0 additions & 10 deletions samples/Catalog/examples/SaveAs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@ export class SaveAs extends BaseExampleAutoHidingHeaderComponent {

constructor(props) {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
10 changes: 0 additions & 10 deletions samples/Catalog/examples/SplitPDF.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ export class SplitPDF extends BaseExampleAutoHidingHeaderComponent {
super(props);
this.state = { dimensions: undefined };
this.pdfRef2 = React.createRef();
const { navigation } = this.props;
navigation.addListener('beforeRemove', e => {
this.pdfRef1?.current?.destroyView();
this.pdfRef2?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
14 changes: 4 additions & 10 deletions samples/Catalog/examples/StateChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ export class StateChange extends BaseExampleAutoHidingHeaderComponent {

constructor(props) {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();
this.state = {
currentPageIndex: 0,
pageCount: 0,
annotationCreationActive: false,
annotationEditingActive: false,
};

navigation.addListener('beforeRemove', e => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down Expand Up @@ -55,6 +45,10 @@ export class StateChange extends BaseExampleAutoHidingHeaderComponent {
pageIndex={this.state.currentPageIndex}
style={styles.pdfColor}
onStateChanged={event => {
if (event.currentPageIndex !== this.state.currentPageIndex) {
return;
}

this.setState({
annotationCreationActive: event.annotationCreationActive,
annotationEditingActive: event.annotationEditingActive,
Expand Down
10 changes: 0 additions & 10 deletions samples/Catalog/examples/ToolbarCustomization.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@ export class ToolbarCustomization extends BaseExampleAutoHidingHeaderComponent {

constructor(props) {
super(props);
const { navigation } = this.props;
this.pdfRef = React.createRef();

navigation.addListener('beforeRemove', () => {
this.pdfRef?.current?.destroyView();
});
}

componentWillUnmount() {
const { navigation } = this.props;
navigation.removeListener('beforeRemove');
}

render() {
Expand Down
Loading

0 comments on commit 7e91b82

Please sign in to comment.