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.

Tue Jan 16, 2018 4:37 pm

Hi

I am working on an existing pdf file with a number of line annotations. Does anybody know how can I get the position (x and y) of the ends of those lines?

Thanks

iaven
 
Posts: 4
Joined: Tue Jan 16, 2018 8:54 am

Wed Jan 17, 2018 2:48 am

Hello,

Thanks for your inquiry. You could capture the location of the line annotation as below code snippet. But after testing, I found the result was not correct. I have logged the issue into our bug tracking system. Once it's fixed, we will let you know.
Code: Select all
            PdfDocument pdf = new PdfDocument("LineAnnotation.pdf");
            PdfAnnotation annotation = pdf.Pages[0].AnnotationsWidget[0];
            if (annotation is PdfLineAnnotationWidget)
            {
                PdfLineAnnotationWidget lineAnn = annotation as PdfLineAnnotationWidget;
                var location = lineAnn.Location;
            }


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Jan 26, 2018 6:16 am

Hello,

I am writing to inform you the issue has been fixed. Please download Spire.PDF Pack(Hot Fix) Version:3.10 and refer to the below code snippet to have a try.
Code: Select all
PdfDocument pdf = new PdfDocument("1372.pdf");
PdfAnnotation annotation = pdf.Page[0].AnnotationsWidget[0];
if(annotation is PdfLineAnnotationWidget)
{
     PdfLineAnnotationWidget lineAnn = annotation as PdfLineAnnotationWidget;
     var endPoint = lineAnn.EndPoint;
     //var startPoint = lineAnn.StartPoint;
}


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Jan 31, 2018 10:06 am

Hello,

Greeting from E-iceblue.
Has the hotfix resolved your issue?
Your feedback will be greatly appreciated.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Sat Feb 17, 2018 11:05 am

Great! It works perfect 8)

iaven
 
Posts: 4
Joined: Tue Jan 16, 2018 8:54 am

Mon Feb 19, 2018 3:52 am

Hello,

Thanks for your feedback.
Feel free to contact us if you need any assistances.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF