Is there any way to merge the the annotCommand to xfdf without using the pdf?

64 views
Skip to first unread message

Muraleekrishna G

unread,
Nov 14, 2016, 1:02:28 PM11/14/16
to PDFTron WebViewer
In our system, we save the XFDF in a backend model as is, instead of merging it to XOD and saving as a file.To view the form in our client, the XFDF data is fetched from server (in the backend model) and merged with the XOD at the client side using webviewer. Our scenario is such that, we have to save the form data for each annotation response change. Currently, however, we are sending entire XFDF which is a long string. I want to know if we could merge the XFDF and  change data (from getAnnotCommand) in the server without using XOD or PDF. 

Matt Parizeau

unread,
Nov 15, 2016, 6:48:00 PM11/15/16
to PDFTron WebViewer
One way you could do it is to store the XFDF for each annotation separately on your server and only concatenate all the values initially when the client loads a document and requests the annotation data.

The add and modify commands have the full XFDF data for the annotation that changed so you could just send this information on each annotation change. Your server would then store each string of XFDF information for an annotation separately. In your serverUrl handler you would just need to combine all the XFDF strings for the individual annotations and wrap it in an xfdf element before returning the data to WebViewer.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Muraleekrishna G

unread,
Nov 16, 2016, 12:44:55 PM11/16/16
to PDFTron WebViewer
Thanks for the input.

I don't want to save the annotations separately. Is there any other way to update the annotation XML in the complete XFDF?. I can think of one solution if the annotCommand can be solely relied to have enough data about changed field and annotations. A usual XML tag find and replace can work. I want to know if this approach is reliable.

Thanks

Matt Parizeau

unread,
Nov 17, 2016, 3:17:07 PM11/17/16
to PDFTron WebViewer
The annotCommand has all the data for the changed fields and annotations so a find and replace of the XML would probably work if you don't want to store the annotations separately.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages