|
@@ -37,7 +37,7 @@ class RCTCPDFPageUtil: NSObject {
|
|
|
if annoation.type == "Widget" {
|
|
|
continue
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
switch type {
|
|
|
case "Highlight", "Squiggly", "Underline", "Strikeout":
|
|
|
if let markupAnnotation = annoation as? CPDFMarkupAnnotation {
|
|
@@ -95,9 +95,7 @@ class RCTCPDFPageUtil: NSObject {
|
|
|
|
|
|
case "FreeText":
|
|
|
if let freeTextAnnotation = annoation as? CPDFFreeTextAnnotation {
|
|
|
- let lowertype = lowercaseFirstLetter(of: type)
|
|
|
-
|
|
|
- annotaionDict["type"] = lowertype
|
|
|
+ annotaionDict["type"] = "freetext"
|
|
|
annotaionDict["title"] = freeTextAnnotation.userName()
|
|
|
annotaionDict["page"] = pageIndex
|
|
|
annotaionDict["content"] = freeTextAnnotation.contents
|
|
@@ -128,18 +126,26 @@ class RCTCPDFPageUtil: NSObject {
|
|
|
|
|
|
case "Media":
|
|
|
if let mediaAnnotation = annoation as? CPDFSoundAnnotation {
|
|
|
- let lowertype = lowercaseFirstLetter(of: type)
|
|
|
-
|
|
|
- annotaionDict["type"] = lowertype
|
|
|
+ annotaionDict["type"] = "sound"
|
|
|
annotaionDict["title"] = mediaAnnotation.userName()
|
|
|
annotaionDict["page"] = pageIndex
|
|
|
annotaionDict["content"] = mediaAnnotation.contents
|
|
|
}
|
|
|
+ case "":
|
|
|
+ if let signatureAnnotation = annoation as? CPDFSignatureAnnotation {
|
|
|
+ annotaionDict["type"] = "signature"
|
|
|
+ annotaionDict["title"] = signatureAnnotation.userName()
|
|
|
+ annotaionDict["page"] = pageIndex
|
|
|
+ annotaionDict["content"] = signatureAnnotation.contents
|
|
|
+ }
|
|
|
+
|
|
|
default:
|
|
|
print("Unhandled type: \(type)")
|
|
|
}
|
|
|
|
|
|
- annotaionDicts.append(annotaionDict)
|
|
|
+ if annotaionDict["type"] != nil {
|
|
|
+ annotaionDicts.append(annotaionDict)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return annotaionDicts
|