python

Python 3 Script to Add Image and Text Annotations to PDF Documents Using pdf-annotate Module Full Project For Beginnners

pdf-annotate

A pure-python library to add annotations to PDFs.

pdf-annotate is a simple library to add PDF annotations to PDFs. Under the hood it uses the powerful and unopinionated pdfrw library to parse the PDF to figure out where to place the annotations.

Usage

from pdf_annotate import PdfAnnotator, Location, Appearance
a = PdfAnnotator('a.pdf')
a.add_annotation(
    'square',
    Location(x1=50, y1=50, x2=100, y2=100, page=),
    Appearance(stroke_color=(1, , ), stroke_width=5),
)
a.write('b.pdf')  # or use overwrite=True if you feel lucky

Annotation Types

pdf-annotate includes most of the basic PDF annotation types, leaving out some of the more complex interactive types. Contributions for these welcome! Currently supported annotation types are:

  • square
  • circle
  • line
  • polygon
  • polyline
  • ink
  • text
  • image

RECENT POSTS

Similar Posts:

    None Found

Leave a Reply

Your email address will not be published. Required fields are marked *