Créer un pdf à partir d'octets Python

file = open('new.pdf', 'wb')
for line in open('code.txt', 'rb').readlines():
    file.write(line)
file.close()
Light Ladybird