Hello
According to https://www.syncfusion.com/products/file-formats/pdf in "FEATURE MATRIX" in "
Annotation Types" section it shows that "FreeText Annotation" are supported in UWP.
BUT
Below code gives me error :
"Unable to cast object of type 'Syncfusion.Pdf.Interactive.PdfPopupAnnotation' to type 'Syncfusion.Pdf.Interactive.PdfLoadedAnnotation'." Stream fileStream = randomAccessStream.AsStreamForRead();
byte[] buffer = new byte[fileStream.Length];
fileStream.Read(buffer, 0, buffer.Length);
PdfLoadedDocument ldoc = new PdfLoadedDocument(buffer);
//Creates a rectangle
System.Drawing.RectangleF rectangle = new System.Drawing.RectangleF(10, 40, 30, 30);
//Creates a new popup annotation.
PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle, "Test popup annotation");
popupAnnotation.Border.Width = 4;
popupAnnotation.Border.HorizontalRadius = 20;
popupAnnotation.Border.VerticalRadius = 30;
//Sets the pdf popup icon.
popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
//Adds the annotation to loaded page
ldoc.Pages[0].Annotations.Add(popupAnnotation);
//Saves the document to disk.
await ldoc.Save();
pdfViewer.LoadDocument(ldoc);
I also tried below code.
//Create a new rectangle
System.Drawing.RectangleF textAnnotationBounds = new System.Drawing.RectangleF(10, 40, 100, 30);
//Create a new line annotation.
PdfFreeTextAnnotation textAnnotation = new PdfFreeTextAnnotation(textAnnotationBounds);
//Set the text and font
textAnnotation.MarkupText = "Text Annotation";
textAnnotation.Font = new PdfStandardFont(PdfFontFamily.Courier, 10);
//Set the line caption type.
textAnnotation.AnnotationIntent = PdfAnnotationIntent.FreeTextCallout;
//Add this annotation to a new page.
ldoc.Pages[0].Annotations.Add(textAnnotation);
await ldoc.Save();
pdfViewer.LoadDocument(ldoc);
Can you provide me UWP example which supports "FreeText Annotation" and all other Annotation.
Thanks in advance.