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.
I'm a python noob so I'm probably doing something simple very wrong, but...
I'm trying to run the example from the documentation, but it says there's a syntax error in graphics.py.
Code:
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=0),
Appearance(stroke_color=(1, 0, 0), stroke_width=5),
)
a.write('b.pdf') # or use overwrite=True if you feel lucky
In terminal:
python sample.py
Output:
Traceback (most recent call last):
File "sample.py", line 1, in <module>
from pdf_annotate import PdfAnnotator, Location, Appearance
File "/Users/myusername/Library/Python/2.7/lib/python/site-packages/pdf_annotate/__init__.py", line 2, in <module>
from pdf_annotate.annotator import PdfAnnotator
File "/Users/myusername/Library/Python/2.7/lib/python/site-packages/pdf_annotate/annotator.py", line 15, in <module>
from pdf_annotate.annotations.image import Image
File "/Users/myusername/Library/Python/2.7/lib/python/site-packages/pdf_annotate/annotations/image.py", line 19, in <module>
from pdf_annotate.annotations.rect import RectAnnotation
File "/Users/myusername/Library/Python/2.7/lib/python/site-packages/pdf_annotate/annotations/rect.py", line 12, in <module>
from pdf_annotate.config.appearance import set_appearance_state
File "/Users/myusername/Library/Python/2.7/lib/python/site-packages/pdf_annotate/config/appearance.py", line 26, in <module>
from pdf_annotate.graphics import ContentStream
File "/Users/myusername/Library/Python/2.7/lib/python/site-packages/pdf_annotate/graphics.py", line 130
new_parents = (*parents, BaseCommand, namedtuple_klass)
^
SyntaxError: invalid syntax
Any idea what I'm doing wrong?
The text was updated successfully, but these errors were encountered:
I'm a python noob so I'm probably doing something simple very wrong, but...
I'm trying to run the example from the documentation, but it says there's a syntax error in graphics.py.
Code:
In terminal:
Output:
Any idea what I'm doing wrong?
The text was updated successfully, but these errors were encountered: