We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

TextAnnotation set icon size

I am using PDF TextAnnotation, it works great. What I am after is to set size of annotation i.e I am using Check and Cross annotation “TextIcon.Cross, TextIcon.Check”. How can I set the height and width of icon as default size is quite large as compared to what I require.


Thanks for contacting support.

We have tried to use TextAnnotation.Height and TextAnnotation.Width properties to control the height/width of the text annotation icon but it did not take effect in the generated output. Hence we have logged an investigation ticket as PDFNET-43534 in our issue tracking system. We will further investigate the logged ticket and keep you updated with the status of its correction. Please be patient and spare us little time.

Please check following code snippet, which we have tried in our environment to test the scenario:

Document pdfDocument = new Document();

// Create annotation
TextAnnotation textAnnotation = new TextAnnotation(pdfDocument.Pages.Add(), new Aspose.Pdf.Rectangle(100, 300, 300, 500));
textAnnotation.Title = "Sample Annotation Title";
textAnnotation.Subject = "Sample Subject";
textAnnotation.State = AnnotationState.Accepted;
textAnnotation.Contents = "Sample contents for the annotation";
textAnnotation.Open = false;
textAnnotation.Icon = TextIcon.Check;
textAnnotation.Height = 50;
textAnnotation.Width = 50;
Border border = new Border(textAnnotation);
border.Width = 5;
border.Dash = new Dash(1, 1);
textAnnotation.Border = border;
textAnnotation.Rect = new Aspose.Pdf.Rectangle(200, 400, 400, 600);

// Add annotation in the annotations collection of the page
dataDir = dataDir + "TextAnnot.pdf";
// Save output file

We are sorry for the inconvenience.