Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The user interface freezes #290

Open
wants to merge 38 commits into
base: 9.4.1-update-changelog
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
36e332b
Update changelog (#283)
darrenchann Dec 5, 2022
bae1124
API to call setFitMode / setLayoutMode outside of config (#284)
darrenchann Dec 16, 2022
c68cb8a
Android 9.4.2 Release (#285)
darrenchann Jan 3, 2023
4a85d08
Rename applications.properties into application.properties (#286)
ama-pdftron Jan 10, 2023
61ed45c
Update gradle-wrapper.jar to 6.7.1 (#287)
ama-pdftron Jan 10, 2023
80e7f8b
Android SDK 9.5.0 (#289)
ama-pdftron Feb 16, 2023
40fda2c
Android 10.0.0 (#291)
ama-pdftron Mar 27, 2023
11c5a46
Update minimum iOS version (#292)
dluco Mar 29, 2023
f2f9e0d
Android targetSDK 33 (#293)
ama-pdftron Mar 29, 2023
a06a8b3
AnnotationSmartPen support in flutter-iOS (#294)
darrenchann Apr 10, 2023
f70aa00
Android 10.1.0 (#295)
ama-pdftron May 8, 2023
b013fa3
Android 10.2.0 (#296)
sgong-pdftron Jun 19, 2023
ead55c8
[Android|Fix] Fix save document auto-save flag (#298)
sgong-pdftron Jul 4, 2023
a8b317c
Update to Android 10.3.0 (#299)
brandenfung2 Jul 31, 2023
6de50ab
[iOS] PTEraser Added to Toolkey (#300)
darrenchann Aug 9, 2023
29364c6
(Android) - added dart method mergeAnnotations - importAnnotations to…
darrenchann Aug 23, 2023
57a404e
Update README.md (#304)
ama-pdftron Aug 24, 2023
41daf9e
Update README.md (#305)
ama-pdftron Aug 24, 2023
f331a5a
Update Apryse Android SDK to version 10.4.0 (#306)
brandenfung2 Sep 12, 2023
698680b
[Android] Fix missing break (#307)
brandenfung2 Sep 21, 2023
7b3fb3f
Update Arpyse Android SDK to version 10.5.0 (#308)
ama-pdftron Oct 24, 2023
08f011c
Update to Apryse Android SDK to Version 10.6.0 (#311)
brandenfung2 Dec 6, 2023
5f6ff30
Fix get latest pubspec in versionBump action (#312)
brandenfung2 Dec 9, 2023
699ed0d
Fix package version update script again (#316)
brandenfung2 Dec 15, 2023
fc02ff1
Expose pan tool (#317)
darrenchann Jan 11, 2024
c5e486b
[Android] Fix issue where status bar appears double height in non-ful…
sgong-pdftron Jan 24, 2024
463f5f7
[Android] Update version to 10.7.0 (#320)
sgong-pdftron Feb 5, 2024
c3fd7d0
[Fix|Android] Support follow system nightmode flag in widget viewer (…
brandenfung2 Feb 23, 2024
1f9dbb4
[Android] Update to 10.8.0 (#321)
sgong-pdftron Mar 19, 2024
f140c92
[Android] Update to 10.9.0 (#322)
sgong-pdftron Apr 29, 2024
3f5a53e
[Android] Fix custom toolbar item press ID (#323)
sgong-pdftron May 27, 2024
f7ae67e
[Android] Update to 10.11.0 (#324)
brandenfung2 Jul 23, 2024
bdce936
[Android] Update to 10.12.0 (#326)
brandenfung2 Sep 3, 2024
40c4bda
Fix github links
ama-pdftron Sep 4, 2024
f19f8d1
Update Github links (#327)
ama-pdftron Sep 4, 2024
88a1bd5
[Example] Update to ApryseSDK link (#328)
ama-pdftron Sep 4, 2024
a04ff85
[Android] Update to 11.0.0 (#330)
ama-pdftron Oct 29, 2024
da3adf8
[Android] Update to 11.1.0 (#331)
ama-pdftron Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pubdev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master
jobs:
build:
if: github.repository == 'PDFTron/pdftron-flutter'
if: github.repository == 'ApryseSDK/pdftron-flutter'
runs-on: ubuntu-latest
container:
image: google/dart:latest
Expand All @@ -27,4 +27,4 @@ jobs:
}
EOF
- name: Publish package
run: pub publish -f
run: pub publish -f
2 changes: 1 addition & 1 deletion .github/workflows/versionBump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Get Latest pubspec.yaml
run: |
git fetch
git checkout -m origin/master pubspec.yaml
git checkout origin/master pubspec.yaml
git add pubspec.yaml
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
Expand Down
75 changes: 73 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,75 @@
# 1.0.0-56 - Dec 2, 2022
# 1.0.0-37 - November 25, 2024
- Update Android to v11.1.0

# 1.0.0-36 - October 28, 2024
- Update Android to v11.0.0
- Update Android targetSDK to 34

# 1.0.0-33 - September 4, 2024
- Update Android to v10.12.0

# 1.0.0-32 - July 24, 2024
- Update Android to v10.11.0

# 1.0.0-31 - May 27, 2024
- Fix bug in `startAnnotationToolbarItemPressedListener`

# 1.0.0-30 - May 1, 2024
- Update Android to v10.9.0

# 1.0.0-29 - March 20, 2024
- Update Android to v10.8.0

# 1.0.0-27 - February 7, 2024
- Update Android to v10.7.0

# 1.0.0-24 - December 13, 2023
- expose Pan tool

# 1.0.0-23 - December 6, 2023
- Update Android to v10.6.0

# 1.0.0-22 - October 25, 2023
- Update Android to v10.5.0

# 1.0.0-21 - September 21, 2023
- Fix bug in mergeAnnotations()

# 1.0.0-20 - September 13, 2023
- Update Android to v10.4.0

# 1.0.0-18 - August 23, 2023
- mergeAnnotations()

# 1.0.0-17 - August 8, 2023
- added eraser to PTToolKey (iOS)

# 1.0.0-16 - August 2, 2023
- Update Android to v10.3.0

# 1.0.0-15 - July 4, 2023
- Fix bug in Android `saveDocument`

# 1.0.0-14 - June 21, 2023
- Update Android to v10.2.0

# 1.0.0-13 - May 10, 2023
- Update Android to v10.1.0

# 1.0.0-9 - Mar 27, 2023
- Update Android to v10.0.0

# 1.0.0-8 - Feb 17, 2023
- Update Android to v9.5.0

# 1.0.0-4 - Dec 19, 2022
- Update Android to v9.4.2

# 1.0.0-3 - Dec 16, 2022
- setFitMode()
- setLayoutMode()

# 1.0.0-2 - Dec 2, 2022
- Update Android to v9.4.1

# 1.0.0-beta.55 - Oct 13, 2022
Expand Down Expand Up @@ -66,7 +137,7 @@

# 1.0.0-beta.3 - November 8, 2021

- Updated the Android plugin and widget ([#128](https://github.com/PDFTron/pdftron-flutter/issues/128)):
- Updated the Android plugin and widget ([#128](https://github.com/ApryseSDK/pdftron-flutter/issues/128)):
- The plugin now supports [Flutter's new embedding engine](https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration).
- The widget now uses [hybrid composition](https://flutter.dev/docs/development/platform-integration/platform-views?tab=ios-platform-views-objective-c-tab#hybrid-composition). This update fixes issues such as: https://github.com/flutter/flutter/issues/58273
and in regards to stability, places the widget on parity with the plugin.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PDFTron's Flutter PDF library brings smooth, flexible, and stand-alone document
- Night mode to improve viewing in low-light environments
- And much more...

More information can be found at https://www.pdftron.com/documentation/guides/flutter
More information can be found at https://docs.apryse.com/documentation/guides/flutter/

**Android**|**iOS**
:--:|:--:
Expand Down Expand Up @@ -36,7 +36,7 @@ More information can be found at https://www.pdftron.com/documentation/guides/fl
Dart now supports [sound null safety](https://dart.dev/null-safety), which is available starting from Dart 2.12.0 and Flutter 2.0.0. Here is a guide to migrate to [null safety](https://dart.dev/null-safety/migration-guide)

If you would like to use our null safe SDK, it is available in the following places:
- [GitHub](https://github.com/PDFTron/pdftron-flutter)
- [GitHub](https://github.com/ApryseSDK/pdftron-flutter)
- [pub.dev](https://pub.dev/packages/pdftron_flutter)

The rest of this README.md contains documentation, installation instructions, and information for the null safe version of our SDK.
Expand All @@ -45,7 +45,7 @@ The rest of this README.md contains documentation, installation instructions, an

Version `0.0.6` is the last stable release for the legacy UI.

The release can be found here: https://github.com/PDFTron/pdftron-flutter/releases/tag/legacy-ui.
The release can be found here: https://github.com/ApryseSDK/pdftron-flutter/releases/tag/legacy-ui.

## Installation

Expand All @@ -67,7 +67,7 @@ The release can be found here: https://github.com/PDFTron/pdftron-flutter/releas
sdk: flutter
+ pdftron_flutter:
+ git:
+ url: git://github.com/PDFTron/pdftron-flutter.git
+ url: git://github.com/ApryseSDK/pdftron-flutter.git
```

3. In the `myapp` directory, run `flutter packages get`.
Expand Down Expand Up @@ -433,11 +433,11 @@ return Scaffold(
```

## Changelog
See [Changelog](https://github.com/PDFTron/pdftron-flutter/blob/publish-prep-nullsafe/CHANGELOG.md)
See [Changelog](https://github.com/ApryseSDK/pdftron-flutter/blob/publish-prep-nullsafe/CHANGELOG.md)

## Contributing
See [Contributing](https://github.com/PDFTron/pdftron-flutter/blob/publish-prep-nullsafe/CONTRIBUTING.md)
See [Contributing](https://github.com/ApryseSDK/pdftron-flutter/blob/publish-prep-nullsafe/CONTRIBUTING.md)

## License
See [License](https://github.com/PDFTron/pdftron-flutter/blob/publish-prep-nullsafe/LICENSE)
![](https://onepixel.pdftron.com/pdftron-flutter)
See [License](https://github.com/ApryseSDK/pdftron-flutter/blob/publish-prep-nullsafe/LICENSE)
![](https://onepixel.pdftron.com/pdftron-flutter)
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 19
Expand All @@ -37,7 +37,7 @@ android {
}

dependencies {
// PDFTron SDK dependencies
implementation "com.pdftron:pdftron:9.4.1"
implementation "com.pdftron:tools:9.4.1"
// Apryse SDK dependencies
implementation "com.pdftron:pdftron:11.1.0"
implementation "com.pdftron:tools:11.1.0"
}
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public class PluginUtils {
public static final String KEY_MATCH_WHOLE_WORD = "matchWholeWord";

// Hygen Generated Method Parameters
public static final String KEY_LAYOUT_MODE = "layoutMode";

public static final String KEY_FIT_MODE = "fitMode";


public static final String EVENT_EXPORT_ANNOTATION_COMMAND = "export_annotation_command_event";
public static final String EVENT_EXPORT_BOOKMARK = "export_bookmark_event";
Expand Down Expand Up @@ -300,6 +304,7 @@ public class PluginUtils {
public static final String FUNCTION_SET_FLAG_FOR_FIELDS = "setFlagForFields";
public static final String FUNCTION_SET_VALUES_FOR_FIELDS = "setValuesForFields";
public static final String FUNCTION_IMPORT_ANNOTATIONS = "importAnnotations";
public static final String FUNCTION_MERGE_ANNOTATIONS = "mergeAnnotations";
public static final String FUNCTION_EXPORT_ANNOTATIONS = "exportAnnotations";
public static final String FUNCTION_FLATTEN_ANNOTATIONS = "flattenAnnotations";
public static final String FUNCTION_DELETE_ANNOTATIONS = "deleteAnnotations";
Expand Down Expand Up @@ -355,6 +360,8 @@ public class PluginUtils {
public static final String FUNCTION_GET_VISIBLE_PAGES = "getVisiblePages";

// Hygen Generated Method Constants
public static final String FUNCTION_SET_LAYOUT_MODE = "setLayoutMode";
public static final String FUNCTION_SET_FIT_MODE = "setFitMode";
public static final String FUNCTION_GET_ANNOTATIONS_ON_PAGE = "getAnnotationsOnPage";

public static final String BUTTON_TOOLS = "toolsButton";
Expand Down Expand Up @@ -406,6 +413,7 @@ public class PluginUtils {
public static final String TOOL_BUTTON_CALLOUT = "calloutToolButton";
public static final String TOOL_BUTTON_STAMP = "stampToolButton";

public static final String TOOL_PAN = "Pan";
public static final String TOOL_ANNOTATION_CREATE_FREE_HAND = "AnnotationCreateFreeHand";
public static final String TOOL_ANNOTATION_CREATE_TEXT_HIGHLIGHT = "AnnotationCreateTextHighlight";
public static final String TOOL_ANNOTATION_CREATE_TEXT_UNDERLINE = "AnnotationCreateTextUnderline";
Expand Down Expand Up @@ -461,10 +469,10 @@ public class PluginUtils {

private static final String LAYOUT_MODE_SINGLE = "Single";
private static final String LAYOUT_MODE_CONTINUOUS = "Continuous";
private static final String LAYOUT_MODE_FACING = "facing";
private static final String LAYOUT_MODE_FACING_CONTINUOUS = "facingContinuous";
private static final String LAYOUT_MODE_FACING_OVER = "facingOver";
private static final String LAYOUT_MODE_FACING_OVER_CONTINUOUS = "facingOverContinuous";
private static final String LAYOUT_MODE_FACING = "Facing";
private static final String LAYOUT_MODE_FACING_CONTINUOUS = "FacingContinuous";
private static final String LAYOUT_MODE_FACING_OVER = "FacingOver";
private static final String LAYOUT_MODE_FACING_OVER_CONTINUOUS = "FacingOverContinuous";

private static final String FIT_MODE_FIT_PAGE = "FitPage";
private static final String FIT_MODE_FIT_WIDTH = "FitWidth";
Expand Down Expand Up @@ -1670,6 +1678,8 @@ private static ToolManager.ToolMode convStringToToolMode(String item) {
mode = ToolManager.ToolMode.SMART_PEN_INK;
} else if (TOOL_ANNOTATION_LASSO.equals(item)) {
mode = ToolManager.ToolMode.ANNOT_EDIT_RECT_GROUP;
} else if (TOOL_PAN.equals(item)) {
mode = ToolManager.ToolMode.PAN;
}
return mode;
}
Expand All @@ -1692,6 +1702,24 @@ private static String convStringToLayoutMode(String layoutString) {
return layoutMode;
}

private static PDFViewCtrl.PagePresentationMode convStringToPagePresentationMode(String pagePresentationString) {
PDFViewCtrl.PagePresentationMode mode = null;
if (LAYOUT_MODE_SINGLE.equals(pagePresentationString)) {
mode = PDFViewCtrl.PagePresentationMode.SINGLE;
} else if (LAYOUT_MODE_CONTINUOUS.equals(pagePresentationString)) {
mode = PDFViewCtrl.PagePresentationMode.SINGLE_CONT;
} else if (LAYOUT_MODE_FACING.equals(pagePresentationString)) {
mode = PDFViewCtrl.PagePresentationMode.FACING;
} else if (LAYOUT_MODE_FACING_CONTINUOUS.equals(pagePresentationString)) {
mode = PDFViewCtrl.PagePresentationMode.FACING_CONT;
} else if (LAYOUT_MODE_FACING_OVER.equals(pagePresentationString)) {
mode = PDFViewCtrl.PagePresentationMode.FACING_COVER;
} else if (LAYOUT_MODE_FACING_OVER_CONTINUOUS.equals(pagePresentationString)) {
mode = PDFViewCtrl.PagePresentationMode.FACING_COVER_CONT;
}
return mode;
}

private static PDFViewCtrl.PageViewMode convStringToFitMode(String fitString) {
PDFViewCtrl.PageViewMode fitMode = null;
if (FIT_MODE_FIT_PAGE.equals(fitString)) {
Expand Down Expand Up @@ -1769,6 +1797,8 @@ public static int convStringToAnnotType(String item) {
annotType = Annot.e_Widget;
} else if (TOOL_FORM_CREATE_TOOL_BOX_FIELD.equals(item)) {
annotType = Annot.e_Widget;
} else if (TOOL_PAN.equals(item)) {
annotType = Annot.e_Unknown;
}
return annotType;
}
Expand Down Expand Up @@ -2151,7 +2181,18 @@ public static void onMethodCall(MethodCall call, MethodChannel.Result result, Vi
checkFunctionPrecondition(component);
String xfdf = call.argument(KEY_XFDF);
try {
importAnnotations(xfdf, result, component);
importAnnotations(xfdf, true, result, component);
} catch (PDFNetException ex) {
ex.printStackTrace();
result.error(Long.toString(ex.getErrorCode()), "PDFTronException Error: " + ex, null);
}
break;
}
case FUNCTION_MERGE_ANNOTATIONS: {
checkFunctionPrecondition(component);
String xfdf = call.argument(KEY_XFDF);
try {
importAnnotations(xfdf, false, result, component);
} catch (PDFNetException ex) {
ex.printStackTrace();
result.error(Long.toString(ex.getErrorCode()), "PDFTronException Error: " + ex, null);
Expand Down Expand Up @@ -2660,6 +2701,16 @@ public static void onMethodCall(MethodCall call, MethodChannel.Result result, Vi
break;
}
// Hygen Generated Method Cases
case FUNCTION_SET_LAYOUT_MODE: {
checkFunctionPrecondition(component);
setLayoutMode(call, result, component);
break;
}
case FUNCTION_SET_FIT_MODE: {
checkFunctionPrecondition(component);
setFitMode(call, result, component);
break;
}
case FUNCTION_GET_ANNOTATIONS_ON_PAGE: {
checkFunctionPrecondition(component);
getAnnotationsOnPage(call, result, component);
Expand Down Expand Up @@ -2822,7 +2873,7 @@ private static void groupAnnotations(MethodCall call, MethodChannel.Result resul
}
}

private static void importAnnotations(String xfdf, MethodChannel.Result result, ViewerComponent component) throws PDFNetException {
private static void importAnnotations(String xfdf, boolean replace, MethodChannel.Result result, ViewerComponent component) throws PDFNetException {
PDFViewCtrl pdfViewCtrl = component.getPdfViewCtrl();
PDFDoc pdfDoc = component.getPdfDoc();
if (null == pdfViewCtrl || null == pdfDoc || null == xfdf) {
Expand Down Expand Up @@ -2852,7 +2903,11 @@ private static void importAnnotations(String xfdf, MethodChannel.Result result,

FDFDoc fdfDoc = FDFDoc.createFromXFDF(xfdf);

pdfDoc.fdfUpdate(fdfDoc);
if (replace) {
pdfDoc.fdfUpdate(fdfDoc);
} else {
pdfDoc.fdfMerge(fdfDoc);
}
pdfDoc.refreshAnnotAppearances();
pdfViewCtrl.update(true);

Expand Down Expand Up @@ -3531,10 +3586,10 @@ private static void importBookmarkJson(String bookmarkJson, MethodChannel.Result
private static void saveDocument(MethodChannel.Result result, ViewerComponent component) {
PdfViewCtrlTabFragment2 pdfViewCtrlTabFragment = component.getPdfViewCtrlTabFragment();
if (pdfViewCtrlTabFragment != null) {
pdfViewCtrlTabFragment.setSavingEnabled(component.isAutoSaveEnabled());
pdfViewCtrlTabFragment.setSavingEnabled(true);
pdfViewCtrlTabFragment.save(false, true, true);
pdfViewCtrlTabFragment.setSavingEnabled(component.isAutoSaveEnabled());

// TODO if add auto save flag: getPdfViewCtrlTabFragment().setSavingEnabled(mAutoSaveEnabled);
if (component.isBase64()) {
try {
byte[] data = FileUtils.readFileToByteArray(pdfViewCtrlTabFragment.getFile());
Expand Down Expand Up @@ -4129,6 +4184,31 @@ private static void getVisiblePages(MethodChannel.Result result, ViewerComponent
}

// Hygen Generated Methods
public static void setLayoutMode(MethodCall call, MethodChannel.Result result, ViewerComponent component) {
PDFViewCtrl pdfViewCtrl = component.getPdfViewCtrl();
String layoutString = call.argument(KEY_LAYOUT_MODE);

if (pdfViewCtrl == null) {
result.error("InvalidState", "PDFViewCtrl not found", null);
return;
}

pdfViewCtrl.setPagePresentationMode(convStringToPagePresentationMode(layoutString));
result.success(null);
}

public static void setFitMode(MethodCall call, MethodChannel.Result result, ViewerComponent component) {
PDFViewCtrl pdfViewCtrl = component.getPdfViewCtrl();
String fitString = call.argument(KEY_FIT_MODE);

if (pdfViewCtrl == null) {
result.error("InvalidState", "PDFViewCtrl not found", null);
return;
}
pdfViewCtrl.setPageViewMode(convStringToFitMode(fitString));
result.success(null);
}

public static void getAnnotationsOnPage(MethodCall call, MethodChannel.Result result, ViewerComponent component) {
int pageNumber = call.argument(KEY_PAGE_NUMBER);

Expand Down Expand Up @@ -4292,7 +4372,7 @@ public static void handleAnnotationCustomToolbarItemPressed(ViewerComponent comp
String itemKey = mToolIdMap.get(itemId);
if (itemKey != null && annotationCustomToolbarItemPressedEventSink != null) {
// this is a custom button
annotationCustomToolbarItemPressedEventSink.success(itemId);
annotationCustomToolbarItemPressedEventSink.success(itemKey);
}
}

Expand Down
Loading