How to store stylus data such as pressure and velocity?

, , ,


We are using a stylus to create handwritten signatures, and we would like to save the biometric information (pressure, speed…) within the PDF.

The PDF standard allows the storage of this data, but I am currently struggling how to do this with PDFNet internal methods.


Since there is no specific support for recording pressure, speed, etc. of a pen, just the points, then you would be adding custom data.

See this section for how to add custom data to a SDF object.

So in your case, you would be adding this custom data to the Annotation or Field object. In particular you would add a sibling Dictionary object to store your data.

Obj annot_obj = annot.GetSDFObj(); Obj metrics_obj = annot_obj.PutDict("BioMetrics"); Obj velocity = metrics_obj.PutArray("Velocity"); velocity.PushBack(value);