PDFTron WinJS: Saving of annotations

Good morning,

We're using PDFTron for Windows 8 within a WinJS application as a POC for a client but currently experience some anomalies when trying to save an annotated document to disk.

From what we found, the best route to go would be to store the annotations as a separate file and then overlaying said file when the user browses back to the document. However, as there are very little documentations regarding the use of PDFTron in WinJS are we no closer to resolving this issue. We tried to save the stream as XFDF file, but due to the stream being locked by WinJS at that particular moment have no way of getting the document saved correctly.

Is this even possible in WinJS, assuming it would be? Our POC is the use of PDFTron which the client is currently using in their native iOS application and would most certainly retain this throughout all of the future applications, but if we're limited in WinJS, would need to look at something else.


Hi Eric,

Currently, the XFDF support on the javascript side is hard to use. We are currently working on a new release that will be out by the end of this week or early next week. This release will make it easier to use XFDF and FDF documents, and in general make file IO a little smoother.

We will provide 2 new functions for use in JavaScript, which are:
var iBuf = fdoc.saveAsXFDFAsync()

You can then use
var fdfDoc = PDFDoc.fdfextract()
in order to merge and extract these.

To save to and load from files using these IBuffers, I suggest looking at the file access sample:

Best Regards,
Tomas Hofmann