@MarkBrouwers
We tried to change the color of the annotations using below code snippet and Aspose.PDF for .NET 22.7 but were unable to achieve correct results:
Document pdfDocument = new Document(dataDir + "Sample_Aspose_ChangeColor_PolyAnnotation.pdf");
foreach (Annotation annotation in pdfDocument.Pages[1].Annotations)
{
if (annotation is PolyAnnotation)
{
annotation.Color = Aspose.Pdf.Color.Magenta;
PolyAnnotation line = (PolyAnnotation)annotation;
line.InteriorColor = Color.Magenta;
line.Characteristics.Background = System.Drawing.Color.Magenta;
}
if(annotation is LineAnnotation)
{
annotation.Color = Aspose.Pdf.Color.Yellow;
LineAnnotation line = (LineAnnotation)annotation;
line.InteriorColor = Color.Yellow;
line.Characteristics.Background = System.Drawing.Color.Yellow;
}
}
pdfDocument.Save(dataDir + "result.pdf");
Hence, an issue as PDFNET-52216 has been logged in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.
We are sorry for the inconvenience.