Forum


Replies: 3   Views: 5447
Solved!!! the generated docx file is corrupted after adding image.
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by bdm  · 27-11-2016 - 17:29

I've been using PHPDOCX (version 5.5) for almost 2 years.This issue happened just last week, I don't have any problem generating files with images in the past.

I tried all possible solution how to prevent it but no success.

After generating file WORD gives a warning that says, The open xml file cannot be opened because there are problems with the content or the file namemight contain invalid characters.

With second warning... WORD found unreadable content. Do you want to recover the contents of this document? After selecting YES the document open just fine with all the correct formating. After saving it in the desktop I can open it again without any issue or warning. Any help will be greatly appreciated cause I tried to find a solution for days without any luck.

Posted by admin  · 27-11-2016 - 17:55

Hello,

Please check if the image you're adding has more than one extension and if it's lowercase. For example, if you are adding a file name such as name.1.jpg or name.JPG, rename it to name.jpg and try again.

Phpdocx 6 added a new function to control these file names with more than one extension and lowercase and uppercase.

Regards.

Posted by bdm  · 27-11-2016 - 18:23

Thank you so much ...

I'm trying to do that right now but I'm using 3rd party (Highcharts) to auto create graph to png into our server.

I also noticed their generated image file name is chart.238efb83bfef4r8ff8.png .

Still finding a way to override that auto-created file name structure and omit the first 6 characters.

Hopefully this is the right solution.

Will let you know. Thank you for prompt reply.

Posted by bdm  · 27-11-2016 - 18:31

That solved my problem.

Thank you again. Great support.