Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Dec 29, 2021 7:54 am

first im adding 1 annotation but when i add another annotation the first annotation is overwritten can someone help me with this problem?

SoloProgrammer
 
Posts: 1
Joined: Wed Dec 29, 2021 7:16 am

Wed Dec 29, 2021 9:39 am

Hello,

Thank you for your inquiry.
I did an initial test using the following code, and found that the first annotation of the result file was not covered. Please try it on your side. If this is not what you need, please provide your sample PDF file and complete test code for our investigation. You could attach them here or send them to us via email ([email protected]). Thanks in advance.
Code: Select all
 PdfDocument pdfDocument = new PdfDocument();
 PdfPageBase page = pdfDocument.Pages.Add();
 RectangleF rect = new RectangleF(0, 30, 100,30);
 PdfFreeTextAnnotation textAnnotation = new PdfFreeTextAnnotation(rect);
 textAnnotation.Text = "Annotation1";
 textAnnotation.LineEndingStyle = PdfLineEndingStyle.Slash;
 page.AnnotationsWidget.Add(textAnnotation);

 rect = new RectangleF(40, 80, 100, 30);
 textAnnotation = new PdfFreeTextAnnotation(rect);
 textAnnotation.Text = "Annotation2";
 page.AnnotationsWidget.Add(textAnnotation);
 pdfDocument.SaveToFile(outputFile);

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Jan 05, 2022 7:39 am

Hello,

Hope you are doing well!
Has the issue been solved now? Could you please give us some feedback at your convenience?
Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron