We can get the rectangle coordinates by retrieving the annotations of the PDF page as PdfLoadedAnnotationCollection
.
Please find the code snippet to achieve the same.
PdfLoadedDocument pdf = new PdfLoadedDocument(@"../../Data/3333.pdf");
PdfLoadedPage lpage = pdf.Pages[0] as PdfLoadedPage;
PdfLoadedAnnotationCollection collection = lpage.Annotations;
for (int i = 0; i < collection.Count; i++)
{
PdfLoadedRectangleAnnotation rectAnnot = collection[i] as PdfLoadedRectangleAnnotation;
RectangleF bounds = rectAnnot.Bounds;
}
As per your requirement, we have created a sample to get the rectangle coordinates by using the above snippet. Please find the sample from the below link,
Sample link: http://www.syncfusion.com/downloads/support/directtrac/166329/ze/SampleWPF818699923
Please try this sample and let us know whether it meets your requirement. Otherwise kindly provide the specific details to us such as screenshot of your required output, sample you have used and other details (if any). It will be helpful for us to analyze more and to provide you better resolution.
Regards,
Pavithra D.