DEV Community

Discussion on: Edit PDF files with Python

Collapse
 
expoashish profile image
Ashish Yadav

Traceback (most recent call last):
File "main.py", line 5, in
can = canvas.Canvas(packet, pagesize=letter)
NameError: name 'packet' is not defined

what is packet here?????????????????

Collapse
 
stokry profile image
Stokry

Ohh thank you, I made one typo, I updated my code: this part was missing:

packet = io.BytesIO()
Enter fullscreen mode Exit fullscreen mode