-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Images produced by addImage look different in Word for Windows and Word for Mac #224
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
Comments
What's the difference? Can you attach screenshots or paste small part of your code? |
The size is not the same in the 2 documents include("../rProjections/FoyerChart.php");// generate the image 2014-05-05 9:35 GMT+02:00 Ivan Lanin [email protected]:
Cordialement, Corinne Zaoui |
I'm unable to reproduce the error. I got the same image size when using this code: $section->addImage('resources/_mars.jpg', array('width' => 100));
$cell = $section->addTable()->addRow(200)->addCell(1300);
$cell->addImage('resources/_mars.jpg', array('width' => 100)); Can you paste the code that you use to create the image without table? |
Is this one solved too? |
No the size are always not the same ...bigger in mac version
|
I can reproduce, Word Mac and Word Windows do not display the images with the same dimensions. |
Ok. I change the issue title. |
I have seen this problem as well |
Just curious, does any one have any idea's on this issue? I don't know enough of the docx format to even make a guess. |
I haven't been able to reproduce the error. Can you take two screenshots that show the difference? |
I have the same problem. |
I also have the same problem. This also holds for textboxes. |
Small Update from my side: It seems to be the conversion from px to pt. After changing only the width and the margin top of the document created with PHPWord to pt, these dimensions where the same on a PC and on a Mac. The solutions seems to be just converting and writing the values in pt. Best regards |
I have the same problem with images. Anything I can do to help / test / try? The Mac version (2011) takes pixels; but uses as points, with the result that the image is 96px/72pt scaled. The Windows version (2013) takes pixels; and when saving the .docx in Word, it changes it to points and does the correct conversion. I made one small change in \src\PhpWord\Style\Image.php: row 63 Changed $this->setUnit('px'); to $this->setUnit('pt'); That fixed it. |
im experiencing the same thing. ive checked the xml of the same document generated on a windows machine using word 2007, and a mac using 2011, but i see no difference in the xml. i believe this is referenced already, but mac 2011 calls pixels, "points". the images are enlarged by 133% which is what you get when you divide the pixel by point, 96/72. because width and height can only be set by pixels, the mac version craps the bed. edit: for the time being, i just run a regex to check |
Hi
I want to put image png on my doc I try with or without table.
But I open the doc with 2 differents Word and the look it's not the same for the 2 documents
How I can fix it?
Thanks
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: