|
@@ -1076,7 +1076,7 @@ function createAnnotation(doc, pagePtr, annotation) {
|
|
|
const typeInt = AnnotationType[annotation.type.toUpperCase()]
|
|
|
|
|
|
const annotPtr = Module._CreateAnnot(doc, pagePtr, typeInt)
|
|
|
-
|
|
|
+ annotation.annotPtr = annotPtr
|
|
|
const { color, borderWidth, contents, date, opacity, fillTransparency, rect } = annotation
|
|
|
if (color) {
|
|
|
setAnnotRGBColor({
|
|
@@ -1124,9 +1124,15 @@ function createAnnotation(doc, pagePtr, annotation) {
|
|
|
case AnnotationType.TEXT:
|
|
|
break
|
|
|
case AnnotationType.LINK:
|
|
|
+ if (annotation.destPage ) {
|
|
|
+ setLinkDest(annotation)
|
|
|
+ }
|
|
|
+ if (annotation.url) {
|
|
|
+ setLinkUri(annotation)
|
|
|
+ }
|
|
|
break
|
|
|
case AnnotationType.FREETEXT:
|
|
|
- const { bgColor, fontName, fontSize, textAlignment, textColor } = annotation
|
|
|
+ const { bgColor, fontName, fontSize, textAlignment, color } = annotation
|
|
|
if (bgColor) {
|
|
|
Module._SetFreeTextBgColor(annotPtr, bgColor.R / 255, bgColor.G / 255, bgColor.B / 255)
|
|
|
} else {
|
|
@@ -1137,7 +1143,7 @@ function createAnnotation(doc, pagePtr, annotation) {
|
|
|
annotPtr,
|
|
|
fontName,
|
|
|
fontSize,
|
|
|
- textColor,
|
|
|
+ color,
|
|
|
textAlignment,
|
|
|
contents
|
|
|
})
|
|
@@ -1163,8 +1169,8 @@ function createAnnotation(doc, pagePtr, annotation) {
|
|
|
case AnnotationType.HIGHLIGHT:
|
|
|
case AnnotationType.UNDERLINE:
|
|
|
case AnnotationType.SQUIGGLY:
|
|
|
- case AnnotationType.STRIKEOUT:
|
|
|
- const { quadPoints } = annotation
|
|
|
+ case AnnotationType.STRIKEOUT: {
|
|
|
+ const { quadPoints, color } = annotation
|
|
|
createMarkup({
|
|
|
pagePtr,
|
|
|
annotPtr,
|
|
@@ -1172,6 +1178,7 @@ function createAnnotation(doc, pagePtr, annotation) {
|
|
|
quadPoints
|
|
|
})
|
|
|
break
|
|
|
+ }
|
|
|
case AnnotationType.STAMP:
|
|
|
const { stampType } = annotation
|
|
|
if (stampType === 'standard') {
|
|
@@ -1224,6 +1231,7 @@ function createWidget(doc, pagePtr, annotation) {
|
|
|
|
|
|
const typeInt = WidgetType[type.toUpperCase()]
|
|
|
const annotPtr = Module._CreateWidget(doc, pagePtr, typeInt)
|
|
|
+ annotation.annotPtr = annotPtr
|
|
|
|
|
|
if (date) {
|
|
|
setAnnotCreationDate({
|
|
@@ -1313,6 +1321,13 @@ function createWidget(doc, pagePtr, annotation) {
|
|
|
const { title: rawTitle } = annotation
|
|
|
const title = stringToNewUTF8(rawTitle)
|
|
|
Module._SetButtonTitle(annotPtr, title)
|
|
|
+
|
|
|
+ if (annotation.destPage) {
|
|
|
+ setPushButtonDest(annotation)
|
|
|
+ }
|
|
|
+ if (annotation.url) {
|
|
|
+ setPushButtonUri(annotation)
|
|
|
+ }
|
|
|
break
|
|
|
case 'textfield':
|
|
|
const { isMultiLine, textAlignment } = annotation
|
|
@@ -2220,14 +2235,14 @@ function createMarkup(data) {
|
|
|
}
|
|
|
|
|
|
function setFreeText(data) {
|
|
|
- const { annotPtr, fontName: rawFontName, fontSize, textColor: rawTextColor, textAlignment, contents: rawContents } = data
|
|
|
+ const { annotPtr, fontName: rawFontName, fontSize, color: rawColor, textAlignment, contents: rawContents } = data
|
|
|
const textAlignmentInt = ALIGNMAP[textAlignment.toUpperCase()]
|
|
|
const fontName = stringToNewUTF8(rawFontName)
|
|
|
const contents = stringToNewUTF8(rawContents)
|
|
|
|
|
|
- const textColor = convertColorToCppFormat(rawTextColor)
|
|
|
+ const color = convertColorToCppFormat(rawColor)
|
|
|
|
|
|
- Module._SetFreeText(annotPtr, fontName, fontSize, textColor.R / 255, textColor.G / 255, textColor.B / 255, textAlignmentInt, contents)
|
|
|
+ Module._SetFreeText(annotPtr, fontName, fontSize, color.R / 255, color.G / 255, color.B / 255, textAlignmentInt, contents)
|
|
|
}
|
|
|
|
|
|
function createShape(data) {
|