Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images not displayed on Open Office #1102

Open
agallou opened this issue Jul 17, 2017 · 0 comments
Open

Images not displayed on Open Office #1102

agallou opened this issue Jul 17, 2017 · 0 comments

Comments

@agallou
Copy link

agallou commented Jul 17, 2017

The issue

First, thank you for your work on PHPOffice, it's a great library that has allowed us to easily implement a Word export in our application.

In our export we add some images to the exported document.
It worked great on multiple word processors but not on Open Office : the images were not displayed.

Here is a gist of a minimalist way to reproduce the problem : https://gist.github.com/agallou/7bb2373491f713bfc94fd622a02b9754
On this example we just add a section and an image in it.

Here is an .docx example generated by this gist :
test.docx.zip (zipped, because github didn't allowed to upload this docx).

Some examples

Not working

The image is not displayed on Open Office 4.1.3, rev 1761381 (on Windows 10) :

win_10_openoffice

Working

The image is displayed on Libre Office 4.2.8.2, Build ID: 420m0 (on Ubuntu 14.4) :

ubuntu_14_4_libreoffice

The image is displayed on WPS Writer 10.1.0.5672 (on Ubuntu 14.4) :

ubuntu_14_4_xps_writer

The image is displayed on Libre Office 5.1.6.2 (on ubuntu 16.1) :

ubuntu_16_4_libreoffice_5 1

The image is displayed on Word 2016, version 1706, build 8229.2073 (on Windows 10) :

win_10_word

Our fix

Some of our users may open our documents with Open Office. So we had to make it work.

After creating a document with an image on WPS Writer and comparing this document.xml from a document generated by PHPOffice, we have changed the image class.

Those changes can be displayed here agallou@0a8f3ac

Besides the alignement, the styles does'nt work, and the image is still not displayed when it's included on the footer.

So it's not an ideal solution and could not be merged as-it but it allowed us to have something usable for our users.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant