Hi I am trying to create note with PDF attachment using plugin.
It creating note with pdf attachment but unable to open that pdf,it says that its damaged or decoded wrongly.
Code is below-
string strMessage = "this is a demo";
byte[] byteData = Encoding.ASCII.GetBytes(strMessage);
tracingService.Trace("string in bytes " + byteData);
string encodedData = Convert.ToBase64String(byteData);
tracingService.Trace("Encoded Data " + encodedData);
Entity Annotation = new Entity("annotation");
Annotation.Attributes["subject"] = "Demo Note 7";
Annotation.Attributes["documentbody"] = encodedData;
Annotation.Attributes["mimetype"] = @"application/pdf";
Annotation.Attributes["notetext"] = "Sample attachment 7";
Annotation.Attributes["filename"] = "Demo7.pdf";
service.Create(Annotation);
If I change mimetype to @”application\msword” or @”text\plain” then its working but with PDF its showing error.