Bug 164163 - FILESAVE xlsm to PDF conversion hangs indefinitely
Summary: FILESAVE xlsm to PDF conversion hangs indefinitely
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.3.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2024-12-04 13:27 UTC by Tobias Wolters
Modified: 2025-02-11 15:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
File to reproduce the issue (40.94 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2024-12-05 07:12 UTC, Tobias Wolters
Details
Screenshot of the running convert-to (40.59 KB, image/png)
2024-12-05 11:58 UTC, m_a_riosv
Details
Screenshot of the hanging process (9.64 KB, image/png)
2024-12-05 12:47 UTC, Tobias Wolters
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Wolters 2024-12-04 13:27:28 UTC
We are using the following command line to convert from .xlsm files to .pdf files:

`soffice --convert-to pdf --outdir testdir <input-xlsm-file>`

This works perfectly for most documents we test with, but we have now received two specific .xlsm files where this command hangs indefinitely.

Due to privacy issues, I can not attach the .xlsm files with the issues in this bug report. Please reach out for more details.

Is is possible to ensure that the command above never hangs indefinitely but instead fails with an error?
Comment 1 m_a_riosv 2024-12-04 14:50:55 UTC
Can you open the files with LibreOffice?

Please attach a sample file, reduce the size as much as possible without private information, and paste the information in Menu/Help/About LibreOffice, there is a copy icon.
Comment 2 Tobias Wolters 2024-12-05 07:12:44 UTC
Created attachment 197945 [details]
File to reproduce the issue

Here is a file that can be used to reproduce the issue.
I suspect that the issue occurs due to the use of the `Application.LanguageSettings.LanguageID` method in the `ConvertUserInput` code module.

It makes sense that LibreOffice doesn't handle this. However, I would argue that the converter should exit with an error instead of hanging in this case.
Comment 3 m_a_riosv 2024-12-05 11:58:59 UTC
Created attachment 197947 [details]
Screenshot of the running convert-to

With your sample file, I can't reproduce the issue.
Comment 4 Tobias Wolters 2024-12-05 12:46:50 UTC
I can see that you are using version 24.2.7. 
I'm running version 24.8.3.2. 

In particular: LibreOffice 24.8.3.2 48a6bac9e7e268aeb4c3483fcf825c94556d9f92

The file conversion hangs on my Windows PC when running this conversion, but it also hangs on Linux.

I have attached an image of the state where it hangs.
Comment 5 Tobias Wolters 2024-12-05 12:47:32 UTC
Created attachment 197949 [details]
Screenshot of the hanging process
Comment 6 Charles Williams 2024-12-05 13:14:49 UTC
I can reproduce the hang on a Mac using the the sample file and:

Version: 24.8.3.2 (AARCH64) / LibreOffice Community
Build ID: 48a6bac9e7e268aeb4c3483fcf825c94556d9f92
CPU threads: 8; OS: macOS 15.1.1; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 7 Roman Kuznetsov 2025-01-11 19:27:38 UTC
I can confirm the hang while export to PDF

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c034a21f359db6bd8ba7b4938d4501bbcc87e21d
CPU threads: 16; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL threaded

but, the Print preview shows over 38000 pages!
Of course the export to PDF will take a age time
Tobias, are you sure you need the cell background color for *all* cells on the sheet in the document? Because even if these cells have no data Calc all these cells with background color includes to print range.
Comment 8 Tobias Wolters 2025-02-10 10:34:26 UTC
Hi Roman.
Thanks for taking a look at this.

That definitely explains why the export takes for ages.
Is it somehow possible to control the exported area programatically, or potentially set an upper limit on the number of exported pages?

I have tried removing the background color from all cells in the document, but this still seems to make the export hang. Do I need to do something else to get the size of the exported PDF down?
Comment 9 Roman Kuznetsov 2025-02-10 15:58:36 UTC
(In reply to Tobias Wolters from comment #8)
> Hi Roman.

 
> I have tried removing the background color from all cells in the document,
> but this still seems to make the export hang. Do I need to do something else
> to get the size of the exported PDF down?

Yes, you have also all call borders there :D Select all sheet and just delete it all and then select only needed you cell range and set up borders only for it
Comment 10 Tobias Wolters 2025-02-11 07:09:20 UTC
That solves the issue - thanks!

Is there any way to programmatically set an upper limit on the number of PDF pages to convert when converting with the `soffice` utility?