Get Path object Coordinates/Position

Hi Team

Is it possible to get the path object coordinates or position of path object in pdf using aspose pdf

Thanks and Regards
Bala

Hi Bala,


Thanks for contacting support.

Can you please share some details regarding your requirement of getting coordinates of Path object, so we may reply accordingly.

However, please note that Aspose.Pdf for .NET supports the feature to search and get coordinates of Text and image objects inside PDF document. For further details, please visit

Hi Team

Thanks for your reply
I would like to delete some path like line shapes, curve which lies in particular rectangle coordinates


Thanks and regards
Balamurugan V

Hi Balamurugan,

Thanks for sharing the details.

I am afraid currently Aspose.Pdf for .NET does not support the feature to delete graph objects from a particular area inside a PDF document. However, you may consider redacting a particular page region.

The RedactArea method is added in PdfAnnotationEditor. This method allows you to redact an area of the document, i.e., remove all contents in the specified rectangle.

PdfAnnotationEditor editor = new PdfAnnotationEditor();
editor.RedactArea(1,
    new Aspose.Pdf.Rectangle(100, 100, 20, 70),
    System.Drawing.Color.White);
editor.BindPdf("source.pdf");
editor.Save("result.pdf");

We also added a class named RedactionAnnotation which can be used to operate with existing redaction annotations and redact them (i.e., flatten annotation and remove text under it).

Document doc = new Document("source.pdf");
RedactionAnnotation annot = new Aspose.Pdf.InteractiveFeatures.Annotations.RedactionAnnotation(
    doc.Pages[1],
    new Aspose.Pdf.Rectangle(200, 500, 300, 600));

annot.FillColor = Aspose.Pdf.Color.Green;
annot.BorderColor = Aspose.Pdf.Color.Yellow;
annot.Color = Aspose.Pdf.Color.Blue;
annot.OverlayText = "REDACTED";
annot.TextAlignment = Aspose.Pdf.HorizontalAlignment.Center;
annot.Repeat = true;

doc.Pages[1].Annotations.Add(annot);
doc.Save("result.pdf");

RedactionAnnotation has a method named Redact(). When this method is called, the redaction annotation is flattened and the text under the annotation is redacted.