Steaming PDF from Python Script to IE

Nathan Treloar ntreloar at avaquest.com
Mon Jun 23 02:23:00 CEST 2003


Thanks to everyone who responded with all this great information. 

It turns out that the automatic line endings were the problem. So:

    out = open("test.pdf", "rb").read()
    print 'Content-type: application/pdf\n\n'
    print out

doesn't work, but:

    out = open("test.pdf", "rb").read()
    print 'Content-type: application/pdf\n\n',
    print out,

and

    out = open("test.pdf", "rb").read()
    sys.stdout.write('Content-type: application/pdf\n\n')
    sys.stdout.write(out)

work.




More information about the Python-list mailing list