Import Book from .docx file failed (because it "contains errors and cannot be converted.")
  • Vote Up0Vote Down JorisJoris
    Posts: 3Member
    Hey everyone!

    When I'm want to import a Book from a docx file an error occurs with the following message: "The .docx file you uploaded contains errors and cannot be converted. Please contact customer support."

    I couldn't find any log file that relates to this error. Can someone help to find the fault?

    Cheers,

    Joris
  • 3 Comments sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Joris,

    The file in Booktype which does the import:
    lib/booktype/importer/docx/docximporter.py
    does support logging, so please try another import and then take a look at the end of this log file, with the less command:
    less +G /var/www/booktype/instance1/logs/booktype.log
    Probably there is some discrepancy between the template of your .docx file and the format that Booktype expects. If you find any relevant output in the log file, please paste it into this forum thread.

    Cheers!

    Daniel

  • Hi Joris!

    What might be is that you need to install python-ooxml from the source https://github.com/booktype/python-ooxml instead of using pip package. We will fix this for the upcoming 2.1 release.

    Aco
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Joris, in the meantime you can also update python-ooxml to the latest commit with the command:

    sudo pip install -e git://github.com/booktype/python-ooxml.git@833e65808b39ca3bc5499f64ad38f73c6458372a#egg=Python_OOXML

    Please let us know if that works for you.

    Cheers!

    Daniel