Import freetext annotation Uncaught TypeError: Cannot read property 'index' of undefined

Hello,

when I export a freetext annotation with annotManager.exportAnnotations I have the following xpdf string:

`

<?xml version="1.0" encoding="UTF-8" ?>





Insert text here

Insert text here

0 0 0 rg /Helvetica 32.59492123015469 Tf font: Helvetica 32.59492123015469pt; text-align: left; color: #E44234 `

When I import the saved xpdfstring with annotManager.importAnnotations I have the following error:

CoreControls.js:600 Uncaught TypeError: Cannot read property 'index' of undefined at ba.va.Ov (CoreControls.js:600) ...

Deleting the “apref” tag seems to fix the error.

Can someone tell me what I am doing wrong?

Hi,

Thanks for contacting us regarding WebVewer!

There’s nothing you are doing wrong here.

Can you let me know the WebViewer version you are using? When I try to import your XFDF using annotManager.importAnnotations, I see some warning messages(see the attachment), but I am not able to see the Uncaught TypeError: Cannot read property ‘index’ of undefined error as you mention. Can you provide more detailed steps that I can follow to see this error message?

We will fix the warning messages in the WebViewer.

Best Regards,
Zhijie Zhang
Software Developer
PDFTron Systems Inc.

import-free-text.png

Hi,

thanks for your reply.

I was unable to reproduce the bug and then I disabled my workaround, waiting it to come back.
Today it happened again and I can tell you more: it doesn’t happened with .pdf files but, at least, with .docx files. I also successfully reproduced the bug with a generic .docx file (simple, only text, only one word).

Hi,

Thanks for the information. I’m able to reproduce with a docx file. A PR that contains the fix is being reviewed.
I can provide you with a custom build to try out. Let me know.

Best Regards,
Zhijie Zhang
Software Developer
PDFTron Systems Inc.