from ironpdf import * # Cargar un PDF existente o crear uno nuevo pdf = PdfDocument("existing.pdf") pageIndex = 0 # Crear un objeto TextAnnotation annotation = TextAnnotation(pageIndex) annotation.Title = "This is the major title" annotation.Subject = "This is a subtitle" annotation.Contents = "This is the long 'sticky note' comment content..." annotation.Icon = TextAnnotation.AnnotationIcon.Help annotation.X = 150 annotation.Y = 200 annotation.Width = 200 annotation.Height = 50 annotation.Opacity = 0.9 annotation.Printable = False annotation.Hidden = False annotation.OpenByDefault = True annotation.ReadOnly = False annotation.Rotatable = True # Añadir la anotación a una página y ubicación específicas dentro del PDF pdf.Annotations.Add(annotation) # Guardar el PDF pdf.SaveAs("existing.pdf")