Re: Cannot load annotations

594 views
Skip to first unread message

Support

unread,
Oct 24, 2012, 3:31:08 PM10/24/12
to pdfnet-w...@googlegroups.com
 
The problem is that the tool is storing the annotations in some sort of proprietary annotation format.
The WebViewer is using XFDF (XML Forms Data Format -http://partners.adobe.com/public/developer/en/xml/XFDF_Spec_3.0.pdf).
 
It is very easy to load/write XFDF by hand but you can also use PDFNet SDK or FDF toollit (http://www.adobe.com/devnet/acrobat/fdftoolkit.html) to work with XFDF on the server side.
 

On Wednesday, October 24, 2012 2:40:26 AM UTC-7, lmvco wrote:
Hi,

I added annotations to a XOD file using XPS annotator. However, when loading this file in WebViewer, the list of annotations is empty.

Code:
    var docViewer = readerControl.docViewer
    var am = new CoreControls.AnnotationManager(docViewer);
    var list = am.GetAnnotationsList();
    console.log("Document has " + list.length + " annotations");

Output:
Document has 0 annotations


On other hand, when loading the same XOD file in Silverlight mode, the same happens (annotations are not shown).


Any idea?

Thanks

Support

unread,
Oct 25, 2012, 6:36:14 PM10/25/12
to pdfnet-w...@googlegroups.com
 
Annotation manager can load/save as XFDF. XFDF is a standard format for annotation and forms interchange in collaborative environments as is documented as part of ISO32000 as well as here http://partners.adobe.com/public/developer/en/xml/XFDF_Spec_3.0.pdf.
 
Similary you can merge and extract annotations and forms (as XFDF or FDF)  from/to PDF using PDFDoc.FDFExtract/FDFMerge() methods. For an example of how to do this, please see FDFTest sample:
 
 
 
Annotations (i.e. XFDF) are not embedded in XOD as part of conversion (pdftron.PDF.Convert.ToXod()) because in the collaborative environment they are supposed to be kept in a database (editing XFDF embedded in XOD would not be efficient/effective) .
 
Having said this you can extract XFDF from PDF at the same time you are generating XOD. You would store XFDF in your DB and would load it (via WebViewer annotation manager) each time document/XOD it loaded.
 
 

On Thursday, October 25, 2012 7:43:00 AM UTC-7, lmvco wrote:
Well, I am not using the annotation tool in WebViewer. My scenario is very simple:

- on sever side, I am adding some annotations to my XOD files using pdftron.PDF.Annots API - http://www.pdftron.com/pdfnet/Javadoc/pdftron/PDF/Annots/package-summary.html
- then, in WebViewer, I want to get access to that annotations using a Javascript API


So, from your answer, can we conclude that annotation manager ignore all annotations created in XOD files (using Annots API) and only handle annotations in XPDF format (regardless the method that they are loaded/saved) ?


Thanks
Reply all
Reply to author
Forward
0 new messages