Kaynağa Gözat

add: xfdf 导出

liutian 1 yıl önce
ebeveyn
işleme
7ba11517c3
30 değiştirilmiş dosya ile 107 ekleme ve 81 silme
  1. 11 14
      packages/core/src/annotation/ink.js
  2. 4 4
      packages/core/src/annotation/link.js
  3. 1 1
      packages/core/src/annotation/paint/freetext.js
  4. 1 1
      packages/core/src/annotation/paint/link.js
  5. 8 3
      packages/core/src/annotation/paint/shape.js
  6. 1 1
      packages/core/src/annotation/paint/text.js
  7. 2 2
      packages/core/src/annotation/stamp.js
  8. 3 3
      packages/core/src/annotation/text.js
  9. 1 1
      packages/core/src/form/add_check_box.js
  10. 1 1
      packages/core/src/form/add_combo_box.js
  11. 1 1
      packages/core/src/form/add_list_box.js
  12. 1 1
      packages/core/src/form/add_push_button.js
  13. 1 1
      packages/core/src/form/add_radio_button.js
  14. 1 1
      packages/core/src/form/add_text_field.js
  15. 5 5
      packages/core/src/form/check_box.js
  16. 4 4
      packages/core/src/form/combo_box.js
  17. 4 4
      packages/core/src/form/list_box.js
  18. 4 4
      packages/core/src/form/push_button.js
  19. 5 5
      packages/core/src/form/radio_button.js
  20. 5 5
      packages/core/src/form/text_field.js
  21. 5 1
      packages/core/src/index.js
  22. 2 2
      packages/core/src/ink_sign.js
  23. 2 2
      packages/core/src/markup/index.js
  24. 27 7
      packages/core/src/worker/compdfkit_worker.js
  25. BIN
      packages/webview/public/example/ComPDFKit Web Viewer developer guides.pdf
  26. BIN
      packages/webview/public/example/ComPDFKit for Web example.pdf
  27. 2 2
      packages/webview/src/components/AnnotationContainer/AnnotationHeader.vue
  28. 0 3
      packages/webview/src/core/downloadXfdf.js
  29. 3 0
      packages/webview/src/core/exportXfdf.js
  30. 2 2
      packages/webview/src/core/index.js

+ 11 - 14
packages/core/src/annotation/ink.js

@@ -475,7 +475,7 @@ export default class Ink extends Base {
       annotation: {
         operate: "mod-annot",
         name: this.annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         inklist,
         rect
       }
@@ -599,8 +599,7 @@ export default class Ink extends Base {
     this.topRect.setAttribute("x", rect.width / 2 + 4)
   }
 
-  render()
-  {
+  render() {
     if (!this.annotation.inklist) {
       return
     }
@@ -612,16 +611,15 @@ export default class Ink extends Base {
     let inkArray = []
     if (Array.isArray(gesture)) {
       inkArray = gesture
-    }
-    else {
+    } else {
       inkArray.push(gesture)
     }
 
-    let rectArray=this.annotation.rect.split(',')
-    let left=parseFloat(rectArray[0])*this.scale
-    let bottom = this.viewport.height- parseFloat(rectArray[1])*this.scale
-    let right=parseFloat(rectArray[2])*this.scale
-    let top=this.viewport.height-parseFloat(rectArray[3])*this.scale
+    let { left, top, right, bottom } = this.annotation.rect
+    left = parseFloat(left * this.scale)
+    bottom = parseFloat(bottom * this.scale)
+    right = parseFloat(right * this.scale)
+    top = parseFloat(top * this.scale)
     const rect={
       left,
       top,
@@ -632,11 +630,10 @@ export default class Ink extends Base {
     }
     this.rect = rect
     const annotation = this.annotation
-    this.start = {x: rect.left,y: rect.bottom}
-    this.end = {x: rect.right,y: rect.top}
+    this.start = { x: rect.left, y: rect.top }
+    this.end = { x: rect.right, y: rect.bottom }
 
-    for(let i=0;i<inkArray.length;i++)
-    {
+    for(let i=0; i < inkArray.length; i++) {
       let points=inkArray[i].split(';')
       let pointArray=[]
       for(let j=0;j<points.length;j++)

+ 4 - 4
packages/core/src/annotation/link.js

@@ -323,7 +323,7 @@ export default class Link extends Base {
 
   getActualRect (viewport, s,) {
     const annotation = this.annotation
-    const [x1, y1, x2, y2] = annotation.rect.split(',')
+    const { left: x1, top: y1, right: x2, bottom: y2 } = annotation.rect
     
     const start = getActualPoint(
       {
@@ -667,7 +667,7 @@ export default class Link extends Base {
       annotation: {
         operate: "mod-annot",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -752,7 +752,7 @@ export default class Link extends Base {
       const annotation = {
         operate: "mod-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       const updateAnnot = Object.assign({}, annotation, props)
       this.eventBus.dispatch('annotationChange', {
@@ -783,7 +783,7 @@ export default class Link extends Base {
 
     const annotation = {
       operate: "mod-annot",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 1 - 1
packages/core/src/annotation/paint/freetext.js

@@ -112,7 +112,7 @@ export default class Freetext {
       const annotation = {
         operate: "add-annot",
         type: 'freetext',
-        page: this.page,
+        pageIndex: this.page,
         textColor: '#000000',
         fillColor: '#FFFFFF',
         fontSize: 16,

+ 1 - 1
packages/core/src/annotation/paint/link.js

@@ -105,7 +105,7 @@ export default class PaintLink {
       const annotationData = {
         operate: "add-annot",
         type: 'link',
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
 

+ 8 - 3
packages/core/src/annotation/paint/shape.js

@@ -381,13 +381,18 @@ export default class PaintShape {
     }
 
     const left = Math.min(...xArray);
-    const bottom = Math.min(...yArray);
+    const bottom = Math.max(...yArray);
     const right = Math.max(...xArray);
-    const top = Math.max(...yArray);
+    const top = Math.min(...yArray);
 
     return {
       path,
-      rect: `${left},${bottom},${right},${top}`
+      rect: {
+        left,
+        bottom,
+        right,
+        top
+      }
     }
   }
   

+ 1 - 1
packages/core/src/annotation/paint/text.js

@@ -101,7 +101,7 @@ export default class Text {
       const annotation = {
         operate: "add-annot",
         type: 'text',
-        page: this.page,
+        pageIndex: this.page,
         textColor: '#FF0000',
         borderColor: '#FF0000',
         fontSize: 16,

+ 2 - 2
packages/core/src/annotation/stamp.js

@@ -328,7 +328,7 @@ export default class Stamp extends Base {
 
   getActualRect (viewport, s,) {
     const annotation = this.annotation
-    const [x1, y1, x2, y2] = annotation.rect.split(',')
+    const { left: x1, top: y1, right: x2, bottom: y2 } = annotation.rect
     
     const start = getActualPoint(
       {
@@ -694,7 +694,7 @@ export default class Stamp extends Base {
       annotation: {
         operate: "mod-annot",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         linePoints: linePoints,
         rect: linePoints
       }

+ 3 - 3
packages/core/src/annotation/text.js

@@ -92,7 +92,7 @@ export default class Text extends Base {
         annotation: {
           operate: "mod-annot",
           name: annotation.name,
-          page: this.page,
+          pageIndex: this.page,
           content: contents,
           contents
         }
@@ -203,7 +203,7 @@ export default class Text extends Base {
       annotation: {
         operate: "mod-annot",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -230,7 +230,7 @@ export default class Text extends Base {
 
   getActualRect (viewport, s,) {
     const annotation = this.annotation
-    const [x1, y1, x2, y2] = annotation.rect.split(',')
+    const { left: x1, top: y1, right: x2, bottom: y2 } = annotation.rect
     
     const start = getActualPoint(
       {

+ 1 - 1
packages/core/src/form/add_check_box.js

@@ -114,7 +114,7 @@ export default class AddCheckBox {
       const annotationData = {
         operate: "add-form",
         type: 'check-box',
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints,
 
         fieldName: this.fieldName,

+ 1 - 1
packages/core/src/form/add_combo_box.js

@@ -112,7 +112,7 @@ export default class AddComboBox {
       const annotationData = {
         operate: "add-form",
         type: 'combo-box',
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints,
 
         fieldName: this.fieldName,

+ 1 - 1
packages/core/src/form/add_list_box.js

@@ -112,7 +112,7 @@ export default class AddListBox {
       const annotationData = {
         operate: "add-form",
         type: 'list-box',
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints,
 
         fieldName: this.fieldName,

+ 1 - 1
packages/core/src/form/add_push_button.js

@@ -112,7 +112,7 @@ export default class AddPushButton {
       const annotationData = {
         operate: "add-form",
         type: 'push-button',
-        page: this.page,
+        pageIndex: this.page,
         format: '0',
         rect: linePoints,
 

+ 1 - 1
packages/core/src/form/add_radio_button.js

@@ -114,7 +114,7 @@ export default class AddRadioButton {
       const annotationData = {
         operate: "add-form",
         type: 'radio-button',
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints,
 
         fieldName: this.fieldName,

+ 1 - 1
packages/core/src/form/add_text_field.js

@@ -114,7 +114,7 @@ export default class AddTextField {
       const annotationData = {
         operate: "add-form",
         type: 'text-field',
-        page: this.page,
+        pageIndex: this.page,
         format: '0',
         rect: linePoints,
 

+ 5 - 5
packages/core/src/form/check_box.js

@@ -538,7 +538,7 @@ export default class CheckBox extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         select: this.annotation.select
       }
       this.eventBus.dispatch('annotationChange', {
@@ -728,7 +728,7 @@ export default class CheckBox extends Base {
       annotation: {
         operate: "del-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
     })
   }
@@ -764,7 +764,7 @@ export default class CheckBox extends Base {
       annotation: {
         operate: "mod-form",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -866,7 +866,7 @@ export default class CheckBox extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       const updateAnnot = Object.assign({}, annotation, props)
       this.eventBus.dispatch('annotationChange', {
@@ -938,7 +938,7 @@ export default class CheckBox extends Base {
 
     const annotation = {
       operate: "mod-form",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 4 - 4
packages/core/src/form/combo_box.js

@@ -728,7 +728,7 @@ export default class ComboBox extends Base {
       annotation: {
         operate: "del-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
     })
   }
@@ -764,7 +764,7 @@ export default class ComboBox extends Base {
       annotation: {
         operate: "mod-form",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -883,7 +883,7 @@ export default class ComboBox extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       if (props.options) {
         props.options = props.options.join(',')
@@ -919,7 +919,7 @@ export default class ComboBox extends Base {
 
     const annotation = {
       operate: "mod-form",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 4 - 4
packages/core/src/form/list_box.js

@@ -706,7 +706,7 @@ export default class ListBox extends Base {
       annotation: {
         operate: "del-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
     })
   }
@@ -742,7 +742,7 @@ export default class ListBox extends Base {
       annotation: {
         operate: "mod-form",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -871,7 +871,7 @@ export default class ListBox extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       if (props.options && Array.isArray(props.options)) {
         props.options = props.options.join(',')
@@ -907,7 +907,7 @@ export default class ListBox extends Base {
 
     const annotation = {
       operate: "mod-form",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 4 - 4
packages/core/src/form/push_button.js

@@ -691,7 +691,7 @@ export default class PushButton extends Base {
       annotation: {
         operate: "del-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
     })
   }
@@ -727,7 +727,7 @@ export default class PushButton extends Base {
       annotation: {
         operate: "mod-form",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -826,7 +826,7 @@ export default class PushButton extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       if ((props.destPage || props.url) && this.annotation.actionType !== '0') {
         annotation.actionType = this.annotation.actionType
@@ -872,7 +872,7 @@ export default class PushButton extends Base {
 
     const annotation = {
       operate: "mod-form",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 5 - 5
packages/core/src/form/radio_button.js

@@ -541,7 +541,7 @@ export default class RadioButton extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         select: this.annotation.select
       }
       this.eventBus.dispatch('annotationChange', {
@@ -731,7 +731,7 @@ export default class RadioButton extends Base {
       annotation: {
         operate: "del-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
     })
   }
@@ -767,7 +767,7 @@ export default class RadioButton extends Base {
       annotation: {
         operate: "mod-form",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -868,7 +868,7 @@ export default class RadioButton extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       const updateAnnot = Object.assign({}, annotation, props)
       this.eventBus.dispatch('annotationChange', {
@@ -944,7 +944,7 @@ export default class RadioButton extends Base {
 
     const annotation = {
       operate: "mod-form",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 5 - 5
packages/core/src/form/text_field.js

@@ -509,7 +509,7 @@ export default class TextField extends Base {
           annotation: {
             operate: "mod-form",
             name: this.annotation.name,
-            page: this.page,
+            pageIndex: this.page,
             value: this.annotation.value
           }
         })
@@ -684,7 +684,7 @@ export default class TextField extends Base {
       annotation: {
         operate: "del-annot",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
     })
   }
@@ -720,7 +720,7 @@ export default class TextField extends Base {
       annotation: {
         operate: "mod-form",
         name: annotation.name,
-        page: this.page,
+        pageIndex: this.page,
         rect: linePoints
       }
     })
@@ -833,7 +833,7 @@ export default class TextField extends Base {
       const annotation = {
         operate: "mod-form",
         name: this.annotation.name,
-        page: this.page
+        pageIndex: this.page
       }
       const updateAnnot = Object.assign({}, annotation, props)
       this.eventBus.dispatch('annotationChange', {
@@ -946,7 +946,7 @@ export default class TextField extends Base {
 
     const annotation = {
       operate: "mod-form",
-      page: this.page
+      pageIndex: this.page
     }
     const updateAnnot = Object.assign({}, annotation, props)
     this.eventBus.dispatch('annotationChange', {

+ 5 - 1
packages/core/src/index.js

@@ -1118,7 +1118,11 @@ class ComPDFKitViewer {
     }
   }
 
-  downloadXfdf () {
+  async exportXfdf () {
+    const   xfdf = await this.messageHandler.sendWithPromise('XFDFExportAnnotations', {
+      doc: this.doc
+    })
+    return
     return fetch(this.optionUrl.webviewBaseUrl + this.optionUrl.downloadAnnotation + "?pdfId=" + this._pdfId, {
       method: 'GET',
       headers: {

+ 2 - 2
packages/core/src/ink_sign.js

@@ -245,7 +245,7 @@ class InkSign {
     // const annotation = {
     //   operate: "add-annot",
     //   type: 'ink',
-    //   page: this.layerData.page + 1,
+    //   pageIndex: this.layerData.page + 1,
     //   lineWidth: 2,
     //   transparency: 0.8,
     //   borderColor: '#000000',
@@ -254,7 +254,7 @@ class InkSign {
     const annotation = {
       operate: "add-annot",
       type: "image",
-      page: this.layerData.page + 1,
+      pageIndex: this.layerData.page + 1,
       imageBase64: this.dataURL,
       // targetPage: pageNum,
       // date: new Date(),

+ 2 - 2
packages/core/src/markup/index.js

@@ -264,8 +264,8 @@ class MarkupAnnotation {
         PointY: curPosition.bottom
       })
 
-      quadPointsX.push([...[curPosition.left, curPosition.right, curPosition.left, curPosition.right]])
-      quadPointsY.push([...[curPosition.top, curPosition.top, curPosition.bottom, curPosition.bottom]])
+      quadPointsX.push(curPosition.left, curPosition.right, curPosition.left, curPosition.right)
+      quadPointsY.push(curPosition.top, curPosition.top, curPosition.bottom, curPosition.bottom)
     }
     
 

+ 27 - 7
packages/core/src/worker/compdfkit_worker.js

@@ -141,7 +141,7 @@ class CPDFWorker {
 
     messageHandler.on('GetAnnotLink', (data) => {
       const { pagePtr, annotPtr } = data
-      
+
       Rect = {}
       Module._GetAnnotRect(pagePtr, annotPtr)
       const rect = {
@@ -154,7 +154,8 @@ class CPDFWorker {
       const rawContent = Module._GetAnnotContent(annotPtr)
       const content = UTF8ToString(rawContent)
       const rawCreateDate = Module._GetAnnotCreationDate(annotPtr)
-      const createDate = parseAdobePDFTimestamp(UTF8ToString(rawCreateDate))
+      const date = UTF8ToString(rawCreateDate)
+      const createDate = date && parseAdobePDFTimestamp(date)
 
       FontDa = {}
       Module._GetAnnotFont(annotPtr)
@@ -279,7 +280,8 @@ class CPDFWorker {
 
       RGBColor = {}
       const fillColor = {}
-      Module._GetAnnotFilledRGBColor(annotPtr)
+      const isFilled = Module._GetAnnotFilledRGBColor(annotPtr)
+      console.log(isFilled)
       for (key in RGBColor) {
         fillColor[key] = roundToDecimalPlaces(RGBColor[key] * 255)
       }
@@ -641,6 +643,12 @@ class CPDFWorker {
       return createAnnotation(doc, pagePtr, annotation)
     })
 
+    messageHandler.on('XFDFExportAnnotations', (data) => {
+      const { doc } = data
+      const xfdfStream = exportXFDFByStream(doc)
+      return xfdfStream.Content
+    })
+
     messageHandler.on('SaveDocumentByStream', (data) => {
       console.log('SaveDocumentByStream')
       const { doc } = data
@@ -699,27 +707,31 @@ function createAnnotation(doc, pagePtr, annotation) {
 
   switch (typeInt) {
     case AnnotationType.HIGHLIGHT:
+      console.log(typeInt, annotation)
       const createColorResult = Module._SetAnnotRGBColor(annotPtr, 1, 0, 0)
+      Module._SetAnnotTransparency(annotPtr, 1)
       console.log(createColorResult)
-
+      
       const createContentReslut = Module._SetAnnotContent(annotPtr, stringToNewUTF8(annotation.content))
       console.log(createContentReslut)
       const { quadPointsX, quadPointsY } = annotation
+
       const length = quadPointsX.length
       let pointXBytes = length * 4
       let pointXPtr = _malloc(pointXBytes)
       for (var i = 0; i < length; i++) {
-        Module.HEAP32[pointXPtr / 4 + i] = 0
+        Module.HEAPF32[pointXPtr / 4 + i] = quadPointsX[i]
       }
 
       let pointYBytes = length * 4
       let pointYPtr = _malloc(pointYBytes)
       for (var i = 0; i < length; i++) {
-        Module.HEAP32[pointYPtr / 4 + i] = 0
+        Module.HEAPF32[pointYPtr / 4 + i] = quadPointsY[i]
       }
 
       const createQuadResult = Module._SetQuadPoints(pagePtr, annotPtr, pointXPtr, pointYPtr, length)
-      console.log(createQuadResult)
+      const update = Module._UpdateAnnotAp(annotPtr, 0)
+      console.log(update)
       break
     case AnnotationType.TEXT:
     case AnnotationType.LINK:
@@ -763,6 +775,14 @@ function saveDocumentByStream(doc) {
   return pdfData
 }
 
+function exportXFDFByStream(doc) {
+  XFDFData={}
+  console.log(doc)
+  Module._XFDFExportAnnotations(doc)
+  return XFDFData
+}
+
+
 function setAnnotRect(data) {
   const { pagePtr, annotPtr, rect } = data
   const { left, right, bottom, top } = rect

BIN
packages/webview/public/example/ComPDFKit Web Viewer developer guides.pdf


BIN
packages/webview/public/example/ComPDFKit for Web example.pdf


+ 2 - 2
packages/webview/src/components/AnnotationContainer/AnnotationHeader.vue

@@ -35,7 +35,7 @@
  
   const useDocument = useDocumentStore()
   const useViewer = useViewerStore()
-  const { removeAllAnnotations, importAnnotations, downloadXfdf } = core
+  const { removeAllAnnotations, importAnnotations, exportXfdf } = core
   const onImport = () => {
     
     uploadFile('.xfdf').then((data) => {
@@ -73,7 +73,7 @@
     // })
     try {
       useViewer.setDownloading(true)
-      const res = await downloadXfdf()
+      const res = await exportXfdf()
       useViewer.setDownloading(false)
       if (!res) {
         useViewer.setDownloadError('Downloaded')

+ 0 - 3
packages/webview/src/core/downloadXfdf.js

@@ -1,3 +0,0 @@
-import core from '@/core'
-
-export default () => core.getDocumentViewer().downloadXfdf()

+ 3 - 0
packages/webview/src/core/exportXfdf.js

@@ -0,0 +1,3 @@
+import core from '@/core'
+
+export default () => core.getDocumentViewer().exportXfdf()

+ 2 - 2
packages/webview/src/core/index.js

@@ -27,7 +27,7 @@ import initConfig from './initConfig'
 import download from './download'
 import addEvent from './addEvent'
 import setTool from './setTool'
-import downloadXfdf from './downloadXfdf'
+import exportXfdf from './exportXfdf'
 import webViewerPageMode from './webViewerPageMode'
 import setToolMode from './setToolMode'
 import setPropertyPanel from './setPropertyPanel'
@@ -78,7 +78,7 @@ export default {
   download,
   addEvent,
   setTool,
-  downloadXfdf,
+  exportXfdf,
   webViewerPageMode,
   setToolMode,
   setPropertyPanel,