Skip to content

Commit fc02ff1

Browse files
Expose pan tool (#317)
* android implementation * iOS implementation * changelog * Updating pubspec.yaml * Updating package version * Updating pubspec.yaml * Updating package version --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 699ed0d commit fc02ff1

File tree

7 files changed

+17
-1
lines changed

7 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.0.0-24 - December 13, 2023
2+
- expose Pan tool
3+
14
# 1.0.0-23 - December 6, 2023
25
- Update Android to v10.6.0
36

android/src/main/java/com/pdftron/pdftronflutter/helpers/PluginUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ public class PluginUtils {
413413
public static final String TOOL_BUTTON_CALLOUT = "calloutToolButton";
414414
public static final String TOOL_BUTTON_STAMP = "stampToolButton";
415415

416+
public static final String TOOL_PAN = "Pan";
416417
public static final String TOOL_ANNOTATION_CREATE_FREE_HAND = "AnnotationCreateFreeHand";
417418
public static final String TOOL_ANNOTATION_CREATE_TEXT_HIGHLIGHT = "AnnotationCreateTextHighlight";
418419
public static final String TOOL_ANNOTATION_CREATE_TEXT_UNDERLINE = "AnnotationCreateTextUnderline";
@@ -1677,6 +1678,8 @@ private static ToolManager.ToolMode convStringToToolMode(String item) {
16771678
mode = ToolManager.ToolMode.SMART_PEN_INK;
16781679
} else if (TOOL_ANNOTATION_LASSO.equals(item)) {
16791680
mode = ToolManager.ToolMode.ANNOT_EDIT_RECT_GROUP;
1681+
} else if (TOOL_PAN.equals(item)) {
1682+
mode = ToolManager.ToolMode.PAN;
16801683
}
16811684
return mode;
16821685
}
@@ -1794,6 +1797,8 @@ public static int convStringToAnnotType(String item) {
17941797
annotType = Annot.e_Widget;
17951798
} else if (TOOL_FORM_CREATE_TOOL_BOX_FIELD.equals(item)) {
17961799
annotType = Annot.e_Widget;
1800+
} else if (TOOL_PAN.equals(item)) {
1801+
annotType = Annot.e_Unknown;
17971802
}
17981803
return annotType;
17991804
}

ios/Classes/PTFlutterDocumentController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ -(PTExtendedAnnotType)convertAnnotationNameToAnnotType:(NSString*)annotationName
786786
PTAnnotationCreateRubberStampToolKey: @(PTExtendedAnnotTypeStamp),
787787
PTAnnotationCreateRedactionToolKey : @(PTExtendedAnnotTypeRedact),
788788
PTAnnotationCreateLinkToolKey : @(PTExtendedAnnotTypeLink),
789+
// @"PTPanToolKey" : @(),
789790
// @"FormCreateTextField" : @(),
790791
// @"FormCreateCheckboxField" : @(),
791792
// @"FormCreateRadioField" : @(),

ios/Classes/PdftronFlutterPlugin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ static NSString * const PTFormCreateComboBoxFieldToolKey = @"FormCreateComboBoxF
120120
static NSString * const PTFormCreateListBoxFieldToolKey = @"FormCreateListBoxField";
121121
static NSString * const PTPencilKitDrawingToolKey = @"PencilKitDrawing";
122122
static NSString * const PTAnnotationSmartPenToolKey = @"AnnotationSmartPen";
123+
static NSString * const PTPanToolKey = @"Pan";
123124

124125
// button
125126
static NSString * const PTStickyToolButtonKey = @"stickyToolButton";

ios/Classes/PdftronFlutterPlugin.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3023,6 +3023,8 @@ - (void)setToolMode:(NSString *)toolMode resultToken:(FlutterResult)flutterResul
30233023
toolClass = [PTPencilDrawingCreate class];
30243024
} else if ([toolMode isEqualToString:PTAnnotationSmartPenToolKey]) {
30253025
toolClass = [PTSmartPen class];
3026+
} else if ([toolMode isEqualToString:PTPanToolKey]) {
3027+
toolClass = [PTPanTool class];
30263028
}
30273029

30283030
if (toolClass) {
@@ -3814,6 +3816,9 @@ + (Class)toolClassForKey:(NSString *)key
38143816
else if ([key isEqualToString:PTEraserToolKey]) {
38153817
return [PTEraser class];
38163818
}
3819+
else if ([key isEqualToString:PTPanToolKey]) {
3820+
return [PTPanTool class];
3821+
}
38173822

38183823
return Nil;
38193824
}

lib/src/constants.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ class Tools {
243243
static const formCreateComboBoxField = 'FormCreateComboBoxField';
244244
static const formCreateListBoxField = 'FormCreateListBoxField';
245245
static const annotationSmartPen = 'AnnotationSmartPen';
246+
static const pan = 'Pan';
246247

247248
/// iOS only.
248249
static const pencilKitDrawing = 'PencilKitDrawing';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pdftron_flutter
22
description: A convenience wrapper to build Flutter apps that use the PDFTron mobile SDK for smooth, flexible, and stand-alone document viewing.
3-
version: 1.0.1-24
3+
version: 1.0.1-25
44
homepage: https://www.pdftron.com
55
repository: https://github.com/PDFTron/pdftron-flutter
66
issue_tracker: https://github.com/PDFTron/pdftron-flutter/issues

0 commit comments

Comments
 (0)