agl / jbig2enc

JBIG2 Encoder
Other
252 stars 86 forks source link

pdf.py can not create correct pdf under windows #1

Closed rubypdf closed 14 years ago

rubypdf commented 14 years ago

python version 2.5 because of the bug of python under windows, file(p).read() can not read all content of output.0000, so the pdf created is not correct, I modify file(p,'rb').read(), but the pdf created is still not correct, is some bigger than it create under linux, I have send you the two pdf files as attachment.

agl commented 14 years ago

My only guess would be that Windows is performing newline conversion. Keep your current change to use file(p, 'rb').read() and alter line 137 to read: file('output.pdf', 'wb').write(str(doc))

and see if output.pdf is any more valid.

(I'm afraid that I don't have a Windows box to try that on.)

rubypdf commented 14 years ago

You got it, the issue is fixed. Thank you very much, and pdf.py support windows now, by the way I have successfully compiled jbig2 under windows by using mingw gcc 4.2

rubypdf commented 14 years ago

btw, I have release windows version jbig2.exe for download, http://soft.rubypdf.com/softwares/windows-version-jbig2-encoder-jbig2-exe

agl commented 14 years ago

Glad to hear that it worked!