Bug 151700 - "Print to file" doesn't work on OSX 12.6
Summary: "Print to file" doesn't work on OSX 12.6
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.1.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Patrick Luby (volunteer)
URL:
Whiteboard: target:7.6.0 target:7.5.0.0.beta2
Keywords:
Depends on:
Blocks: macOS-UI-polish
  Show dependency treegraph
 
Reported: 2022-10-22 12:24 UTC by monochromec
Modified: 2022-12-15 08:22 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (161.77 KB, image/png)
2022-10-23 07:28 UTC, monochromec
Details
Sample Of Libre Office Process Before Freeze (119.97 KB, text/plain)
2022-10-28 02:38 UTC, Mike Little
Details
Sample Of LibreOffice Process After Freeze (117.11 KB, text/plain)
2022-10-28 02:39 UTC, Mike Little
Details

Note You need to log in before you can comment on or make changes to this bug.
Description monochromec 2022-10-22 12:24:58 UTC
Description:
An expected PDF file is not produced.

Steps to Reproduce:
1. Create Writer, Calc, Impress, etc. document
2. Invoke File->Print
3. Choose "Print to File" in the resulting dialog
4. Specify file name and location

Actual Results:
PDF file is not generated

Expected Results:
Generated PDF file


Reproducible: Always


User Profile Reset: No

Additional Info:
No printer defined in the OS

More than happy to provide additional information if required
Comment 1 ⁨خالد حسني⁩ 2022-10-22 17:09:23 UTC
Can you attach a screenshot of the print dialog? I get system print dialog and it does not have "Print to File", but I can select "Save as PDF" from a drop down menu and it saves a PDF file just fine.
Comment 2 monochromec 2022-10-23 07:28:34 UTC
Created attachment 183213 [details]
Screenshot
Comment 3 ⁨خالد حسني⁩ 2022-10-23 07:55:42 UTC
I had to force not using system print dialog (setting UseSystemPrintDialog to false), but I still can’t reproduce, selecting Print to File and providing a file name results in PDF being generated.
Comment 4 monochromec 2022-10-24 06:06:03 UTC
Where do I do this / how do I do this on OSX? I found a file called registrymodifications.xcu in /Users/<user>/Library/Application Support/LibreOffice/4/user but am unsure how to incorporate the setting in there.

Changing the option "UseLibreOffice dialogs" in Preferences->LibreOffice->General didn't make a difference.
Comment 5 ⁨خالد حسني⁩ 2022-10-24 07:53:49 UTC
Preferences → LibreOffice → Advanced → Open Expert Configuration, and search for UseSystemPrintDialog. No idea why “Use LibreOffice dialogs” does not affect it (it seems to affect file dialog only).

Both the system and LO dialogs allow me to print to file, though.
Comment 6 monochromec 2022-10-25 06:36:08 UTC
Unfortunately this doesn't make a difference as the dialog stays the same. What version of OSX are you using?
Comment 7 ⁨خالد حسني⁩ 2022-10-25 11:59:49 UTC
I’m using 12.6 (Monterey)
Comment 8 monochromec 2022-10-26 06:36:47 UTC
🤔
Can reproduce this is also on Ventura.

Do you have any printer configured in the OS as such?
Comment 9 Mike Little 2022-10-26 06:50:59 UTC
(In reply to monochromec from comment #8)
> 🤔
> Can reproduce this is also on Ventura.
> 
> Do you have any printer configured in the OS as such?

Hello... I am upgrading to Ventura 13.0 waitout... also I notice bug is on an ARM processor... I will be checking on a x86 Mac...
Comment 10 Mike Little 2022-10-27 07:02:54 UTC
(In reply to monochromec from comment #8)
> 🤔
> Can reproduce this is also on Ventura.
> 
> Do you have any printer configured in the OS as such?

Version: 7.4.1.2 / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 4; OS: Mac OS X 13.0; UI render: default; VCL: osx
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded



System Version:	macOS 13.0 (22A380)
  Kernel Version:	Darwin 22.1.0
  Boot Volume:	Macintosh HD
  Boot Mode:	Normal
  Computer Name:	mlittle-macmini-20200921’s Mac mini
  Username:	mlittle-macmini-20200921 (mlittle-macmini-20200921)
  Secure Virtual Memory:	Enabled
  System Integrity Protection:	Enabled
  Time since boot:	16 hours, 55 minutes


1.	Operating system upgraded to Ventura [macOS 13.0 (22A380)]
2.	Captured the Sample Process from Activity Monitor  before starting LibreOffice. This is “SampleOfLibreOfficeProcessBeforeFreeze.txt”.

A.	TESTING WRITER
===========================
1.	Start application from the ./soffice.sh.
2.	Executed Create Writer Document: unnamed Document opened with the cursor at the insert point …. 
3.	But after about 30 second, the application stopped responding.  Did not Capture the sample  process from Activity Monitor.
4.	I will repeat two more times.
5.	Restart application. 
6.	Executed Create Writer Document: unnamed Document opened with the cursor at the insert point …
7.	Copy and pasted content from “The Age” [https://www.theage.com.au/environment/conservation/calls-for-urgent-creek-clean-up-but-rubbish-removal-could-take-months-20221026-p5bt61.html]
8.	Saved document. This took 4 minutes.
9.	After about 5 minutes, the Application did not respond.
10.	Captured the Sample Process from Activity Monitor for the non-responding LibreOffice.  This is “SampleOfLibreOfficeProcessAfterFreeze02.txt”.
11.	Kill application process from the Activity Monitor.
12.	Restart application.
13.	Started stopwatch..
14.	Executed Create Writer Document: unnamed Document opened with the cursor at the insert point.
15.	Waitied 15 min, LibreOffice operated correctly.
16.	Copy and pasted content from https://www.australiandefence.com.au/news/labor-reveals-new-defence-budget
17.	Saved document.
18.	Waited 10 minutes. Application appears to be stable.
19.	Commernce test of problem identified above concerning Print to File…”Save as PDF”
20.	Choose File>Print
21.	Choose “Save As PDF” 
22.	PDF file created successfully. Application Stable.

I shall test Calc, Impress, Draw. More to come. Wait Out.
Comment 11 Mike Little 2022-10-28 02:38:28 UTC
Created attachment 183307 [details]
Sample Of Libre Office Process Before Freeze
Comment 12 Mike Little 2022-10-28 02:39:45 UTC
Created attachment 183308 [details]
Sample Of LibreOffice Process After Freeze
Comment 13 monochromec 2022-10-28 08:26:09 UTC
Repeated the procedure as outlined by Mike but could not reproduce the delay he experienced when saving the document.

Dialog / issue still remains the same: No "Save to PDF" option available.
Comment 14 Mike Little 2022-11-02 06:53:57 UTC
00.	STATE INFORMATION, TEST SETUP PRIOR TO TEST
•	================================================


State of computer prior to test execution:
1.	CPU Load:
System:  4.23%;
User:  7.98%.;
Idle: 87.79%  

2.	Memory Load: 
Physical Memory: 8.00 GB
Memory Used: 6.70 GB
Cached Files: 1.41 GB
Swap used: 2.09 GB
App Memory: 2.12 GB
Wired Memory: 2.35 GB
Compressed Memory: 2.12 GB

3.	System Software Overview:
  System Version:	macOS 13.0 (22A380)
  Kernel Version:	Darwin 22.1.0
  Boot Volume:	Macintosh HD
  Boot Mode:	Normal
  Computer Name:	mlittle-macmini-20200921’s Mac mini
  Username:	mlittle-macmini-20200921 (mlittle-macmini-20200921)
  Secure Virtual Memory:	Enabled
  System Integrity Protection:	Enabled
  Time since boot:	6 days, 21 hours, 49 minutes

4.	LibreOffice application details:
Version: 7.4.1.2 / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 4; OS: Mac OS X 13.0; UI render: default; VCL: osx
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
5.	Download “pivot.ods” from https://help.libreoffice.org/latest/sq/text/scalc/06/calcsamplefiles.html
6.	
7.	Captured the Sample Process from Activity Monitor before starting LibreOffice.




A.	TESTING Calc
===========================
1.	Start application from the ./soffice.sh. LibreOffice opened successfully presenting the document navigator window.
2.	Executed Create Calc Spreadsheet, Calc opened a blank spreadsheet, with the cell A1 highlighted in light blue. Operated as expected. 
3.	Opened “pivot.ods”.  “pivot.ods” opened successfully and presenting the populated pivot chart of car inventory of 2017. 
4.	Save Document as “Pivot-test.ods”. Document saved successfully. 
5.	Commenced test of problem identified above concerning Print to File…”Save as PDF”
6.	Choose File>Print. Print dialog appears.
7.	Choose “Save As PDF”  Path select presented as expected. 
8.	PDF file created successfully. Application Stable.

As test produced a stable result, the sample process details prior to test execution "
SampleOfLibreOfficeProcessBeforeFreeze2022-11-02—1725.txt" has not been uploaded.
Comment 15 Mike Little 2022-11-03 07:18:11 UTC
00STATE INFORMATION, TEST SETUP PRIOR TO TEST
================================================

1. CPU Load
--------------------------------------------------------------------------------------

System:  30.64%
User:  11.42%
Idle: 57.95%

2. Memory Load
--------------------------------------------------------------------------------------
Physical Memory: 8.00 GB
Memory Used: 6.47 GB
Cached Files: 1.57 GB
Swap used: 1.19 GB
App Memory: 2.40 GB
Wired Memory: 2.58 GB
Compressed Memory: 2.35 GB

3. System Software Overview 
--------------------------------------------------------------------------------------
  System Version:	macOS 13.0 (22A380)
  Kernel Version:	Darwin 22.1.0
  Boot Volume:	Macintosh HD
  Boot Mode:	Normal
  Computer Name:	mlittle-macmini-20200921’s Mac mini
  Username:	mlittle-macmini-20200921 (mlittle-macmini-20200921)
  Secure Virtual Memory:	Enabled
  System Integrity Protection:	Enabled
  Time since boot:	6 days, 21 hours, 49 minutes


4. LibreOffice application details
--------------------------------------------------------------------------------------
Version: 7.4.1.2 / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 4; OS: Mac OS X 13.0; UI render: default; VCL: osx
Locale: en-AU (en_AU.UTF-8); UI: en-US

1.	Start application from the ./soffice.sh. LibreOffice opened successfully presenting the document navigator window.
2.	Capture the Sample Process from Activity Monitor before starting LibreOffice, Impress. 
3.	Execute “Impress Presentation” 
4.	Create an Impress file by importing an existing MS PowerPoint document.  File imported correctly. 

C.TESTING IMPRESS
===========================
1.	Commenced test of problem identified above concerning Print to File…”Save as PDF”
2.	Choose File>Print. Print dialog  appears. 
3.	Choose “Save As PDF”  Path select presented as expected. 
4.	PDF file created successfully. Application Stable.
Comment 16 Mike Little 2022-11-03 07:19:27 UTC
(In reply to monochromec from comment #13)
> Repeated the procedure as outlined by Mike but could not reproduce the delay
> he experienced when saving the document.
> 
> Dialog / issue still remains the same: No "Save to PDF" option available.

Hello, I have not observed that behaviour. see my results below...
Comment 17 Patrick Luby (volunteer) 2022-12-09 00:11:08 UTC
There is a workaround: install a printer driver that prints to PDF. One that I have used is a free, open source print driver called RWTS-PDFwriter. A fake printer is really useful when you want to save PDFs in Adobe Acrobat Reader to PDFs that are viewable in the Preview application through Adobe's non-native print dialog.

You can download the installer (download the "RWTS-PDFwriter.pkg" file) from the following link:

https://github.com/rodyager/RWTS-PDFwriter/releases/tag/v2.0

As for fixing the problem: I have posted the following patch that forces LibreOffice to display the macOS native print dialog even if there are no printers setup on your machine. The patch still needs some tweaking and then review but there is a fix in the works:

https://gerrit.libreoffice.org/c/core/+/143794
Comment 18 Commit Notification 2022-12-13 06:09:39 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/229b0ce8d8453960c213da59770b8bb7b6dca895

tdf#151700 Display native print panel even if there are no printers

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2022-12-14 08:25:47 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/25040486c00c96198165ff15d461815067d2efcc

tdf#151700 Display native print panel even if there are no printers

It will be available in 7.5.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Mike Little 2022-12-15 04:35:23 UTC
(In reply to Commit Notification from comment #19)

STATE INFORMATION, TEST SETUP PRIOR TO TEST
===========================
1.	Downloaded from daily build [ https://dev-builds.libreoffice.org/daily/master/MacOSX-x86_64@tb92-TDF/2022-12-15_03.43.22/ ] LibreOfficeDev_7.6.0.0.alpha0_MacOS_x86-64.dmg, 2022-Dec-15 02:42
2.	LibreOffice Version About Information:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bef199febca711c9aa3fd199e8ca525b7d97a04f
CPU threads: 4; OS: Mac OS X 13.0.1; UI render: Skia/Metal; VCL: osx
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded


TESTING WRITER
===========================
1.	Start application from the ./soffice.sh. [Done, operated correctly].
2.	Executed Create Writer Document: unnamed Document opened with the cursor at the insert point ….  Done, operated correctly]..
3.	Copy and pasted content from “The Age” [ https://www.theage.com.au/environment/conservation/calls-for-urgent-creek-clean-up-but-rubbish-removal-could-take-months-20221026-p5bt61.html  ] Done, operated correctly]..
4.	Choose File>Print Done, operated correctly].
5.	Choose PDF, then Save As PDF” Done, operated correctly].
6.	PDF file created successfully. Application Stable.


 CONCLUSION.
===========================
I OBSERBVED THAT THE OPERATION OF THIS APPLICATION WAS AS PER EXPECTATIONS, AND SO THE DEFECT APPEARS TO BE FIXED. I PROPOSE THAT THE STATUS OF THIS DEFECT BE CHANGED TO "RESOLVED".