How to add Sticky Notes, Insert Text at cursor, .. Annotations in existing PDF file using iTextSharp with C#?

前端 未结 2 1930
逝去的感伤
逝去的感伤 2021-01-25 21:13

I want to add Annotations comment in existing PDF file using iTextSharp with C#.

Please give sample code to add Annotations in existing PDF file.

Here PS Script

2条回答
  •  情书的邮戳
    2021-01-25 21:45

    rect = GetPosition(screening);
    

    can someone plz explain why is this is used..is there any way to find the current cursor position (top,bottom,height,width)

    as with the annotation,

    Document doc = new Document(PageSize.A4, 50, 50, 50, 50);
            PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(@"C:\Users\Asus\Desktop\Test.pdf", FileMode.OpenOrCreate));
            doc.AddDocListener(writer);
            doc.Open();
    
            doc.Add(new Annotation("annotation", "The text displayed in the sticky note", 100f, 500f, 200f, 600f));
            doc.Close();
    

    this works fine to me..

提交回复
热议问题