I am using pspdfkit to add few text annotations via the viewer. After adding the annotations I want to change their contents when the user clicks save button, and then save the pdf. I am not sure how to save the original pdf and also if I want to create a copy of it ?
This is how I get the doc and change the annotations text.
var doc = PdfView.Controller.GetPdfDocument();
var annots =await doc.GetAnnotationsAsync(0);
//I am assuming all my anotations are text (just for testing)
foreach (IAnnotation item in annots)
{
((Text)item).Contents = "Changed content";
}
I can export it using
await pdfView.Document.ExportAsync(dataWriter);
but how to create dataWriter from the doc.
Help will be appreciated.
thanks