PDF XLSX
Aspose.PDF  for .NET
PDF

Get Redaction annotations from PDF via Python

Build your own Python apps to manipulate comments & authors in document files using server-side APIs.

How to retrieve Redaction annotations from PDF using Python

In order to annotate PDF file, Aspose.PDF for .NET API which is a feature-rich, powerful and easy to use PDF manipulation and conversion API for Python platform. Even one can also generates password-protected PDF files. Create requirements.txt with this content.

pip==21.3.1
pycparser==2.21
pythonnet==2.5.2
setuptools==60.1.0

PowerShell Console

    pip install -r requirements.txt

Get Redaction Annotations from PDF via Python

You need aspose.pdf.dll to try the code in your environment.

  • Load PDF in an instance of Document class
  • Get a reference to an existing Page
  • Make a LINQ query to Page.Annotations Redaction annotation and filter only AnnotationType.Redaction
  • Iterate through results and make desired action (e.g. print location coordinates)

System Requirements

Aspose.PDF for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible Linux OS with .NET Framework, .NET Core.
  • Development environment like Microsoft Visual Studio Code or JetBrains PyCharm.
  • Aspose.PDF for .NET DLL referenced in your project.
 

Get Annotations from PDF - Python


    def redaction_annotation_get(self, infile):

        path_infile = self.dataDir + infile

        pdfDocument = Document(path_infile)
        redactionAnnotations = [a for a in pdfDocument.Pages[1].Annotations if (a.AnnotationType == AnnotationType.redaction)]

        for pa in redactionAnnotations:
            print (pa.Rect)
 
  • About Aspose.PDF for .NET API

    Aspose.PDF API can be used for PDF document manipulation and parsing within applications. One can create, modify, compress, secure, print or save PDF to TXT, HTML, PCL, XFA, XML, XPS, EPUB, TEX, Images and more formats. Aspose.PDF is a standalone API and it does not depend on any software including Adobe Acrobat.

    Remove Annotation from PDF via Online App