Custom annotation stamp not loading

232 views
Skip to first unread message

Kai Brümmer

unread,
Oct 20, 2014, 2:54:32 AM10/20/14
to pdfnet-w...@googlegroups.com
Dear all,

I have PDFs from a customer with a custom stamp inside. This stamp is shown in Foxit Reader as you see in annotation.png. But in webviewer only the popup is shown.
This error comes twice in FireBug while loading and again for any annotations related click:

TypeError: k is null

...c=k.x,b=k.y,h=e.x-k.x;k=e.y-k.y;a.fillRect(c,b,h,k);a.strokeRect(c,b,h,k);e=this...


CoreControls.js (line 631)


For other clicks this error occurs:

TypeError: b is null

...ath(),c=0;c<a.length;c++)2!==c&&(b=a[c],this.ad.push(new h.sj(b.x,b.y,h.ControlH...
-------------------------------------------^

CoreControls.js (line 534, col 364)


The attached annots.xfdf is extraced from the xod.
CoreControls.js is VERSION="1.5.2"

Thank you in advance.
Annots.xfdf
annotation.png

Matt Parizeau

unread,
Oct 20, 2014, 2:40:11 PM10/20/14
to pdfnet-w...@googlegroups.com
Hi Kai,

So it looks like the problem is actually with the callout annotations in your XFDF. The callout attribute in your XFDF is formatted like x1,y1,x2,y2,x3,y3 whereas WebViewer was expecting it like x1,y1;x2,y2;x3,y3. It seems that Acrobat exports the callout attribute with all commas so this should be handled by WebViewer. You can download a build that fixes this issue from here: http://pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_1.8.0.27408.zip

As for your stamp, unfortunately WebViewer doesn't have full support for custom stamp annotations. It currently only displays basic stamps like "Approved" or "Draft" and will fallback to just displaying the "icon" attribute text for custom stamps like yours.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Kai Brümmer

unread,
Oct 21, 2014, 2:14:03 AM10/21/14
to pdfnet-w...@googlegroups.com
Dear Matt,

thank you for this fix. Now all annotations are showing up. The custom stamp just shows the icon name instead of the icon. So we hope you will support this in near future.
But I still get this error twice when document opens:
Error: Unknown message command options - CoreWorker.js (line 114)

Regards Kai

Kai Brümmer

unread,
Oct 21, 2014, 7:53:04 AM10/21/14
to pdfnet-w...@googlegroups.com
Dear Matt,

an other issue, we have with custom annotations: We added diamond sample for custom annotations to our config.js. We can save and load these annotations in webviewer, but if we merge the annotations into the pdf using PDFNetC.dll version 6.2.3.25820 the diamond is missing.
The next issue: If we have an annotated pdf converted to xod and the annotations are saved in webviewer, we get the annotations twice in the merged pdf. The original from the pdf and the saved from the xml. Is it possible to remove internal annotations before or while merging the saved ones into it?

Thank you

Regards Kai

Am Montag, 20. Oktober 2014 20:40:11 UTC+2 schrieb Matt Parizeau:

Matt Parizeau

unread,
Oct 21, 2014, 7:21:21 PM10/21/14
to pdfnet-w...@googlegroups.com
Hi Kai,

Make sure to replace CoreWorker.js along with CoreControls.js (from the new build) in your project and I believe that error should go away.

Since custom annotations aren't part of the PDF spec they will only be able to be saved/loaded in WebViewer and won't be able to be merged back to a PDF.

You could remove all the annotations from the PDF using PDFNet so that there won't be duplicate ones when the annotations are merged back in. See this post https://groups.google.com/d/msg/pdfnet-sdk/KCjW6ZBdDM4/_a07eESMpgMJ

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Kai Brümmer

unread,
Oct 22, 2014, 2:19:40 AM10/22/14
to pdfnet-w...@googlegroups.com
Dear Matt,

I already replaced all files from the latest release yesterday. I rechecked and all files are up to date. But the two errors continue.

The removal of the original annotations works fine. Thank you.

Regards Kai

Matt Parizeau

unread,
Oct 22, 2014, 8:08:20 PM10/22/14
to pdfnet-w...@googlegroups.com
Hi Kai,

Maybe you could try clearing the cache to make sure it isn't picking up the old CoreWorker.js file. I just tried downloading from the WebViewer link that I posted previously and tried viewing a file and didn't see any errors in the console. I also tried placing the old CoreWorker.js inside the newly downloaded project and got the error message you're seeing.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Kai Brümmer

unread,
Oct 23, 2014, 2:28:32 AM10/23/14
to pdfnet-w...@googlegroups.com
Very strange: I cleared server cache and browser cache still the same. But in IE, it thows no error. So it seems to be fine now. Thank you
Reply all
Reply to author
Forward
0 new messages