As a PDF is definitely a binary file, I would change that to: file(filename, "wb") I read in Python documentation that on some platforms this can treat files as ASCII files and ruin binary files. ![]() Given my limited knowledge of Python all I might point you to is the line: file(filename, "w") ![]() It's strange that Adobe Reader and Acrobat throw a fit on this file, while many other (worse) PDF readers (such as Mac OS X Preview) seem to show it without any problem.Īll of this said, you seem to have a problem with line endings. I think this is what breaks Adobe Reader. Lines see 7.2, "Lexical Conventions."Each line shall be terminated byĪn end-of-line (EOL) marker, which may be a CARRIAGE RETURN (0Dh), a "As a matter of convention, the tokens in a PDF file are arranged into When you open your file with a binary editor (or a good text editor showing invisible characters) you'll see that each line ending consists of three line-ending characters:Ĭarriage Return, Carriage Return, Line feed ![]() ![]() But I do think I know what the problem is and that should help you find the solution you're looking for. I'm not a Python expert (I know the name, that's about it) so my solution may not be correct.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |