python - Rendering pdf file from base64 string -
i have pdf file encoded base64. created simple script saving pdf file:
import base64 open('pdf.b64', mode='r') fpdf: open('output.pdf', mode='wb') output: base64.decode(fpdf, output) output.close() fpdf.close()
after script runs, have pdf file expected, it's broken. decided compare correct pdf file file got , noticed every line in correct pdf file ends "^m", example:
correct pdf file header: %pdf-1.7^m
my pdf file header: %pdf-1.4
so, doing wrong here?
Comments
Post a Comment