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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -