Skip to content

Commit 4b4bada

Browse files
Reinhard HafenscherRadAzzouz
andauthored
Fix stamps not being correctly detected (#384)
* Fix stamps not being correctly detected * Fix stamps and polylines not being correctly detected on iOS Co-authored-by: RadAzzouz <[email protected]>
1 parent 0355c8e commit 4b4bada

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

android/src/main/java/com/pspdfkit/react/helper/ConversionHelpers.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public static EnumSet<AnnotationType> getAnnotationTypeFromString(@Nullable fina
6464
if ("pspdfkit/text".equalsIgnoreCase(type)) {
6565
return EnumSet.of(AnnotationType.FREETEXT);
6666
}
67+
if ("pspdfkit/stamp".equalsIgnoreCase(type)) {
68+
return EnumSet.of(AnnotationType.STAMP);
69+
}
6770
return EnumSet.noneOf(AnnotationType.class);
6871
}
6972
}

ios/RCTPSPDFKit/Converters/RCTConvert+PSPDFAnnotation.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ + (PSPDFAnnotationType)annotationTypeFromInstantJSONType:(NSString *)type {
5454
return PSPDFAnnotationTypeLine;
5555
} else if ([type isEqualToString:@"pspdfkit/shape/polygon"]) {
5656
return PSPDFAnnotationTypePolygon;
57+
} else if ([type isEqualToString:@"pspdfkit/shape/polyline"]) {
58+
return PSPDFAnnotationTypePolyLine;
5759
} else if ([type isEqualToString:@"pspdfkit/shape/rectangle"]) {
5860
return PSPDFAnnotationTypeSquare;
5961
} else if ([type isEqualToString:@"pspdfkit/text"]) {
6062
return PSPDFAnnotationTypeFreeText;
63+
} else if ([type isEqualToString:@"pspdfkit/stamp"]) {
64+
return PSPDFAnnotationTypeStamp;
6165
} else {
6266
return PSPDFAnnotationTypeUndefined;
6367
}

0 commit comments

Comments
 (0)