Description: I would like to report a rendering/import issue regarding column widths in Excel (.xlsx) files. When opening or previewing an uploaded Excel file, the application seems to ignore the manually set column widths and forces an "AutoFit" behavior based on the content length. Steps to Reproduce: 1. Create a new spreadsheet in **Microsoft Excel** and save it as `test.xlsx`. 2. In a column, enter a short text string (e.g., `"Test"`). 3. Manually expand the column width to a value significantly wider than the content (e.g., set the width to **20 or 30**). 4. *(Optional but recommended)* Create merged cells in adjacent rows to better expose layout issues. 5. Convert the Excel file to PDF using LibreOffice in headless mode with the following command: ```bash soffice --headless --convert-to pdf test.xlsx Actual Results: The column width in the generated PDF is automatically reduced to fit the text content, as if AutoFit were applied, ignoring the manually defined column width set in Excel. Expected Results: The column width in the output PDF should preserve the original width defined in Excel, regardless of the content length. Reproducible: Always User Profile Reset: No Additional Info: ## Version of LibreOffice sh-4.4# /opt/libreoffice7.5/program/soffice --version LibreOffice 7.5.3.2 9f56dff12ba03b9acd7730a5a481eea045e468f3 ## System info Report generated on Tue Jan 20 07:35:37 AM UTC 2026 ======================================== SYSTEM INFORMATION ======================================== Kernel: Linux 6.17.8-orbstack-00308-g8f9c941121b1 Hostname: 320dcd6f6c2c NAME="SLES" VERSION_ID="15.7" PRETTY_NAME="SUSE Linux Enterprise Server 15 SP7" CPE_NAME="cpe:/o:suse:sles:15:sp7" ======================================== DISPLAY ENVIRONMENT ======================================== XDG_SESSION_TYPE: Unknown XDG_CURRENT_DESKTOP: Unknown DESKTOP_SESSION: Unknown GDK_BACKEND: Unset QT_QPA_PLATFORM: Unset ======================================== GRAPHICS / GPU ======================================== > Command: lspci (NOT FOUND) > Command: glxinfo (NOT FOUND) ======================================== LIBREOFFICE VERSION ======================================== Standard 'libreoffice' or 'soffice' command not found in PATH. ======================================== LO SPECIFIC ENV VARS ======================================== ======================================== JAVA ======================================== > Command: java -version openjdk version "21.0.7" 2025-04-15 LTS OpenJDK Runtime Environment SapMachine (build 21.0.7+6-LTS) OpenJDK 64-Bit Server VM SapMachine (build 21.0.7+6-LTS, mixed mode, sharing)
Please attach a sample file(s), reduce the size as much as possible without private information, and paste in the answer the information in Menu/Help/About LibreOffice, there is a copy icon.
Created attachment 205141 [details] An example .xlsx file with manually set column widths.
Created attachment 205142 [details] The column width was shrunk. After conversion with LibreOffice in headless mode, the column widths were reduced.
(In reply to m_a_riosv from comment #1) > Please attach a sample file(s), reduce the size as much as possible without > private information, and paste in the answer the information in > Menu/Help/About LibreOffice, there is a copy icon. Hi Roisv, Thank you for your attention. I’ve attached the example files.
I can't reproduce the issue. Version: 25.8.4.2 (X86_64) Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win Locale: en-GB (es_ES); UI: en-US Calc: threaded Please test in safe mode, Menu/Help/Restart in Safe Mode If it doesn't work please try updating your LibreOffice versions.
(In reply to m_a_riosv from comment #5) > I can't reproduce the issue. > Version: 25.8.4.2 (X86_64) > Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df > CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: > Skia/Raster; VCL: win > Locale: en-GB (es_ES); UI: en-US > Calc: threaded > > Please test in safe mode, Menu/Help/Restart in Safe Mode > > If it doesn't work please try updating your LibreOffice versions. Hi Riosv, Thanks for you reply. I need to clarify that I encountered this issue in headless mode, not in the GUI, so options like Menu → Help → Restart are not available. Please refer to the newly provided PDF document, which demonstrates that when LibreOffice converts files to HTML in headless mode, it does not handle column width calculation well in cases involving merged cells. The command I used: ```shell ./soffice --headless --convert-to html excel.xls ``` The original file has been uploaded as an attachment. Please refer: 1. explain.pdf 2. column-widths-are-squeezed-when-cells-are-merged-generated-by-soffice.html 3. column-widths-are-squeezed-when-cells-are-merged.xls I'm looking forward to your response. BR, Shiwei
Created attachment 205191 [details] Column widths are squeezed when cells are merged. The excel file which demostrate column widths are squeezed when cells are merged.
Created attachment 205192 [details] HTML Source Generated by LibreOffice Showing Column Width Squeezing with Merged Cells This is the HTML source code generated after I converted column-widths-are-squeezed-when-cells-are-merged.xls to HTML using LibreOffice. The command I used: soffice --headless --convert-to html excel.xls
Created attachment 205193 [details] This file is intended to explain the issue where column widths are shrunk. This file is intended to explain the issue where column widths are shrunk.
In our product, we use LibreOffice to convert customer-uploaded Excel files into a previewable format. This relies on LibreOffice’s feature for converting Excel files to HTML. ./soffice --headless --convert-to html excel.xls We hope this issue can be fixed so that the converted HTML renders consistently with the preview in Microsoft Excel. Thank you very much.
On GUI mode I can't see the issue saving as HTML happens, but exporting as XHTML works fine, try with it. There are a long list of issues with HTML, but I don't think it is going to get some attraction to solve them. Better try with XHTML.