You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, hello. When I tried to convert HTML to docx, I found that the width of the image was not the expected width. So, I decompressed the docx and opened document.xml. I found that the width of the image is pixels (px), which makes the document see different image widths when opened on computers with different resolutions. So I tried to search for documents and the internet, but only saw that the unit of image width written in the development document was pt. So I looked up the source code of PHPWord and found that in PhpOffice\PhpWord\Shared\Html, the units for width and height in lines 903 and 909 are UNIT-PX. Why is it that the unit in the source code is UNIT-PX instead of UNIT-PT (as stated in the development documentation, the unit is pt)? Is there any other consideration for writing this way? Or can this be considered a bug?
Also, I would like to know how to set the width of an image to the width of A4 paper. My English level is not very good. Thank you for taking the time to read my question. Thank you very much for your help!
Describe the Bug
Hi, hello. When I tried to convert HTML to docx, I found that the width of the image was not the expected width. So, I decompressed the docx and opened document.xml. I found that the width of the image is pixels (px), which makes the document see different image widths when opened on computers with different resolutions. So I tried to search for documents and the internet, but only saw that the unit of image width written in the development document was pt. So I looked up the source code of PHPWord and found that in
PhpOffice\PhpWord\Shared\Html
, the units for width and height in lines 903 and 909 are UNIT-PX. Why is it that the unit in the source code is UNIT-PX instead of UNIT-PT (as stated in the development documentation, the unit is pt)? Is there any other consideration for writing this way? Or can this be considered a bug?Also, I would like to know how to set the width of an image to the width of A4 paper. My English level is not very good. Thank you for taking the time to read my question. Thank you very much for your help!
Steps to Reproduce
php
Expected Behavior
Expected: The width of the image is 449.25pt.
Current Behavior
The content of document.xml:
<v:shape type="#_x0000_t75" stroked="f" style="width:904px; height:574px;...
I omitted some of the code, and what is expected here is "<v: shape type=" # _x0000_t75 "stroke=" f "style=" width: 449.25pt; "; Height: 574pt “
Context
Please fill in your environment information:
The text was updated successfully, but these errors were encountered: