Hi Samuele,
It looks like this is because the log in Chrome doesn't take a snapshot of the array at the time of logging. See this link:
http://stackoverflow.com/a/24176305. The key from there is:
As of today, dumping an object (array) into console will result in objects' properties being read upon console object expansion (i.e. lazily). This means that dumping the same object while mutating it will be hard to debug using the console.
So at the time of the logging there are no annotations in the list, however at the time you expanded the array in the console there were two annotations in the list. You can verify this by adding console.log(annotations.length) immediately after your console.log(annotations) and you'll see that the length is zero at that time.
If you want to do something with the annotations right after they're loaded you can find the call to ImportAnnotationsAsync inside ReaderControl.js and add a callback as the second parameter. This callback will be called when the initial annotations have been loaded. e.g.
am.ImportAnnotationsAsync(data, function(annots) {
console.log("loaded annotations");
});
Matt Parizeau
Software Developer
PDFTron Systems Inc.