You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
Can you tell me what is expected to put in the Appearance()? I tried to add content = 'test' but kept giving me the 'NoneType' object is not subscriptable error.
from pdf_annotate import PdfAnnotator, Location, Appearance
a = PdfAnnotator('a.pdf')
a.add_annotation(
'text',
Location(x1=50, y1=50, x2=100, y2=100, page=0),
Appearance(),
)
a.write('b.pdf')
The text was updated successfully, but these errors were encountered:
I managed to add text amending the ReadMe example like this:
from pdf_annotate import PdfAnnotator, Location, Appearance
a = PdfAnnotator('a.pdf')
a.add_annotation(
'text',
Location(x1=50, y1=50, x2=100, y2=100, page=0),
Appearance(stroke_color=(1, 0, 0), stroke_width=5, content="hello world", fill=(0.705, 0.094, 0.125, 1))
)
a.write('b.pdf') # or use overwrite=True if you feel
'content' is the text you want to write and 'fill' is the colour. 'Fill' seems to accept RGB(A) normalised decimal colours. I used this colour picker to get the value:
Can you tell me what is expected to put in the Appearance()? I tried to add content = 'test' but kept giving me the 'NoneType' object is not subscriptable error.
from pdf_annotate import PdfAnnotator, Location, Appearance
a = PdfAnnotator('a.pdf')
a.add_annotation(
'text',
Location(x1=50, y1=50, x2=100, y2=100, page=0),
Appearance(),
)
a.write('b.pdf')
The text was updated successfully, but these errors were encountered: