Skip to content

Commit

Permalink
Release 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PSPDFKit committed May 8, 2023
1 parent f6a1a53 commit 7e28d95
Show file tree
Hide file tree
Showing 87 changed files with 1,481 additions and 545 deletions.
1,000 changes: 613 additions & 387 deletions ACKNOWLEDGEMENTS.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
## Newest Release

### 3.6.0 - 08 May 2023
- Adds measurement tools. (#39806)
- Updates for PSPDFKit 8.6.0 for Android. (#39501)
- Updates for PSPDFKit 12.2 for iOS. (#39995)

## Previous Releases

### 3.5.1 - 15 Mar 2023
- Updates iOS license initialization in the example catalog. (#38999)
- Updates Instant web demo links. (#39018)
- Updates for PSPDFKit 8.5.1 for Android. (#39090)
- Updates for PSPDFKit 12.1.2 for iOS. (#39090)

## Previous Releases

### 3.5.0 - 17 Jan 2023
- Adds Instant Synchronization support. (#37675)
- Updates for PSPDFKit 8.5 for Android. (#38136)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
All items and source code Copyright © 2010-2022 PSPDFKit GmbH.
All items and source code Copyright © 2010-2023 PSPDFKit GmbH.

PSPDFKit is a commercial product and requires a license to be used.

Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2019-2022 PSPDFKit GmbH. All rights reserved.
# Copyright © 2019-2023 PSPDFKit GmbH. All rights reserved.
#
# THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
# AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down
9 changes: 4 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2018-2022 PSPDFKit GmbH. All rights reserved.
* Copyright © 2018-2023 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down Expand Up @@ -37,10 +37,10 @@ apply plugin: 'kotlin-android'

android {
compileSdkVersion androidCompileSdkVersion

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
Expand All @@ -57,5 +57,4 @@ dependencies {
implementation "com.pspdfkit:$pspdfkitMavenModuleName:$pspdfkitVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
}
6 changes: 3 additions & 3 deletions android/config.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2018-2022 PSPDFKit GmbH. All rights reserved.
* Copyright © 2018-2023 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down Expand Up @@ -38,7 +38,7 @@ if (pspdfkitMavenUrl == null || pspdfkitMavenUrl == '') {

ext.pspdfkitVersion = localProperties.getProperty('pspdfkit.version')
if (pspdfkitVersion == null || pspdfkitVersion == '') {
ext.pspdfkitVersion = '8.5.1'
ext.pspdfkitVersion = '8.6.0'
}

ext.pspdfkitMavenModuleName = 'pspdfkit'
Expand All @@ -56,4 +56,4 @@ ext.androidCompileSdkVersion = 33
ext.androidMinSdkVersion = 21
ext.androidTargetSdkVersion = 33
ext.androidGradlePluginVersion = '7.4.2'
ext.kotlinVersion = "1.8.0"
ext.kotlinVersion = "1.8.10"
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2018-2022 PSPDFKit GmbH. All rights reserved.
* Copyright © 2018-2023 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down
4 changes: 2 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright © 2018-2022 PSPDFKit GmbH. All rights reserved.
~ Copyright © 2018-2023 PSPDFKit GmbH. All rights reserved.
~
~ THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
~ AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand All @@ -14,7 +14,7 @@

<application android:largeHeap="true">
<activity
android:name=".FlutterPdfActivity"
android:name="com.pspdfkit.flutter.pspdfkit.FlutterPdfActivity"
android:windowSoftInputMode="adjustNothing" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2018-2022 PSPDFKit GmbH. All rights reserved.
* Copyright © 2018-2023 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down Expand Up @@ -29,6 +29,7 @@
import com.pspdfkit.configuration.settings.SettingsMenuItemType;
import com.pspdfkit.configuration.sharing.ShareFeatures;
import com.pspdfkit.configuration.theming.ThemeMode;
import com.pspdfkit.preferences.PSPDFKitPreferences;
import com.pspdfkit.ui.special_mode.controller.AnnotationTool;

import java.util.ArrayList;
Expand Down Expand Up @@ -181,6 +182,12 @@ class ConfigurationAdapter {
// Instant Options
private static final String ENABLE_INSTANT_COMMENTS = "enableInstantComments";

// Measurement tools options
private static final String ENABLED_MEASUREMENT_TOOLS = "enableMeasurementTools";
private static final String ENABLE_MAGNIFIER = "enableMagnifier";
private static final String ENABLED_MEASUREMENT_TOOL_SNAPPING = "enableMeasurementToolSnapping";


@NonNull
private final PdfActivityConfiguration.Builder configuration;
@Nullable
Expand Down Expand Up @@ -363,9 +370,25 @@ class ConfigurationAdapter {
if (key != null) {
enableInstantComments = (boolean) configurationMap.get(key);
}

key = getKeyOfType(configurationMap, ENABLE_MAGNIFIER, Boolean.class);
if (key != null) {
configureMagnifierEnabled((Boolean) configurationMap.get(key));
}

key = getKeyOfType(configurationMap, ENABLED_MEASUREMENT_TOOLS, Boolean.class);
if (key != null) {
configureMeasurementToolsEnabled((Boolean) configurationMap.get(key));
}

key = getKeyOfType(configurationMap, ENABLED_MEASUREMENT_TOOL_SNAPPING, Boolean.class);
if (key != null) {
configureMeasurementToolSnappingEnabled(context,(Boolean) configurationMap.get(key));
}
}
}


private void configurePageTransition(@NonNull final String transition) {
switch (transition) {
case PAGE_TRANSITION_SCROLL_PER_SPREAD:
Expand Down Expand Up @@ -711,6 +734,18 @@ private void configureAutosaveEnabled(boolean autosaveEnabled) {
configuration.autosaveEnabled(autosaveEnabled);
}

private void configureMeasurementToolsEnabled(Boolean aBoolean) {
configuration.setMeasurementToolsEnabled(aBoolean);
}

private void configureMagnifierEnabled(Boolean aBoolean) {
configuration.enableMagnifier(aBoolean);
}

private void configureMeasurementToolSnappingEnabled(Context context,Boolean aBoolean) {
PSPDFKitPreferences.get(context).setMeasurementSnappingEnabled(aBoolean);
}

private <T> boolean containsKeyOfType(@NonNull HashMap<String, Object> configurationMap,
@NonNull String key,
@NonNull Class<T> clazz) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///
/// Copyright © 2021-2022 PSPDFKit GmbH. All rights reserved.
/// Copyright © 2021-2023 PSPDFKit GmbH. All rights reserved.
///
/// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
/// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand All @@ -12,6 +12,10 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.pspdfkit.document.PdfDocument;

import org.jetbrains.annotations.NotNull;

import java.util.HashMap;

import io.flutter.plugin.common.MethodChannel;
Expand Down Expand Up @@ -48,6 +52,8 @@ public void notifyActivityOnPause() {
sendEvent("flutterPdfActivityOnPause");
}



public void notifyInstantSyncStarted(String documentId) {
sendEvent("pspdfkitInstantSyncStarted", documentId);
}
Expand Down Expand Up @@ -86,4 +92,8 @@ private void sendEvent(@NonNull final String method, @Nullable final Object argu
channel.invokeMethod(method, arguments, null);
}
}

public void notifyDocumentLoaded(@NotNull PdfDocument document) {
sendEvent("pspdfkitDocumentLoaded", document.getUid());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.pspdfkit.flutter.pspdfkit

/// Copyright © 2021-2022 PSPDFKit GmbH. All rights reserved.
/// Copyright © 2021-2023 PSPDFKit GmbH. All rights reserved.
///
/// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
/// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.pspdfkit.annotations.measurements.FloatPrecision;
import com.pspdfkit.annotations.measurements.Scale;
import com.pspdfkit.document.PdfDocument;
import com.pspdfkit.ui.PdfActivity;

Expand All @@ -21,10 +23,21 @@ public class FlutterPdfActivity extends PdfActivity {
@Nullable private static FlutterPdfActivity currentActivity;
@NonNull private static final AtomicReference<Result> loadedDocumentResult = new AtomicReference<>();

@Nullable private static Scale scale;
@Nullable private static FloatPrecision floatPrecision;

public static void setLoadedDocumentResult(Result result) {
loadedDocumentResult.set(result);
}

public static void setMeasurementScale(@Nullable final Scale scale) {
FlutterPdfActivity.scale = scale;
}

public static void setFloatPrecision(@Nullable final FloatPrecision floatPrecision) {
FlutterPdfActivity.floatPrecision = floatPrecision;
}

@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
Expand All @@ -51,6 +64,14 @@ public void onDocumentLoaded(@NonNull PdfDocument pdfDocument) {
if (result != null) {
result.success(true);
}

if (scale != null) {
pdfDocument.setMeasurementScale(scale);
}

if (floatPrecision != null) {
pdfDocument.setMeasurementPrecision(floatPrecision);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.pspdfkit.flutter.pspdfkit

import com.pspdfkit.annotations.measurements.FloatPrecision
import com.pspdfkit.annotations.measurements.Scale
import com.pspdfkit.document.PdfDocument
import com.pspdfkit.ui.PdfUiFragment

class FlutterPdfUiFragment : PdfUiFragment() {

private var scale: Scale? = null
private var precision: FloatPrecision? = null

override fun onDocumentLoaded(document: PdfDocument) {
super.onDocumentLoaded(document)
// Notify the Flutter PSPDFKit plugin that the document has been loaded.
EventDispatcher.getInstance().notifyDocumentLoaded(document)
// We can register interest in newly created annotations so we can easily pick up measurement information.
if (scale != null) {
document.measurementScale = scale
}
if (precision != null) {
document.measurementPrecision = precision
}
}

fun setMeasurementScale(scale: Scale?) {
this.scale = scale
}

fun setMeasurementPrecision(precision: FloatPrecision?) {
this.precision = precision
}

}
Loading

0 comments on commit 7e28d95

Please sign in to comment.