Skip to content

Last page of CHM incompletly rendered or missing  #41

Description

@GoogleCodeExporter
I have some trouble with the last pages of my documents.

In one case, i get some ERR011: Unable to parse HTML element on line 49! from 
htmldoc on the last pages.
The strange thing is, that if I re-run the very same htmldoc command dipalyed 
with the --verose --verbosity high level (obviosly not deleting the temporary 
files), the pdf will be complete and no error ERR011 is rised.
It's like the last file written by the conversion before invoking HTMLDOC is 
still open or not completely written!

In an other case, the last page is simply completly missing, without any error 
message.

But the code look just fine to me:

            pf=open(filename,'w')
            pf.write(page)
            pf.close

What could be wrong??

Writing a dummy file afterwards before invoking HTMLDOC resolves the problem, 
but this seems quite a ugly hack to me (I am not a programmer).

Then I found the command
           pf.flush()

This also solves the problem. But why is this necessary??

Original issue reported on code.google.com by [email protected] on 26 Nov 2011 at 9:27

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions