onSavePageAsPDF - it is no longer possible to use it with other programs

REPRODUCIBILITY: 100%
OS VERSION: 5.0.0.61
HARDWARE: XA2, C2
UI LANGUAGE: German
REGRESSION: yes

DESCRIPTION:

Since SFOS version 5.0.0.21 it is no longer possible to use the “onSavePageAsPDF” function from the browser’s Overlay.qml code with other programs.
In my case, for example, it is used in jolla-email und a modified MessageViewPullDown.qml, where I have integrated the adapted code (beside a modified “HtmlViewer.qml”)

If you currently want to save the message as a PDF, only a 0 byte file is created in the Downloads directory.
The permissions of the created file are rw-------.
Before SFOS 5.0, a PDF file was created with the permissions rw-r–r–.
When starting the action, you can see the following message in the terminal:

JavaScript error: , line 0: uncaught exception: Object

PRECONDITIONS:

Sailfish 5.0.0.21 and higher with the new Sailfish Browser (ESR91)
A modified MessageViewPullDown.qml (and modified “HtmlViewer.qml”)

STEPS TO REPRODUCE:

  1. open an email
  2. select “Nachricht als PDF speichern” (“save message as pdf”) from pulley
  3. expecting a PDF file saved in downloads

EXPECTED RESULT:

A PDF was created from the email and saved in downloads.

ACTUAL RESULT:

A 0 byte file is created in the Downloads directory. It has strange permissions (rw-------)

MODIFICATIONS:

No patches on the C2, apart from the modifications mentioned above.

ADDITIONAL INFORMATION:

screenshot

I’ve been looking around a bit and I think my problem might have something to do with these adjustments here
[embedlite-components] Reintroduce DownloadPDFSaver

Fix Qt printing pipeline for ESR 91 #1030

2 Likes

That’s not really a bug report as I don’t have this option in email client, so can’t really reproduce, looks like a problem with a patch? Should report it to the patch author

Same happens in my browser app Ielig:Web. I can confirm this bug.
It’s an error in the Sailfish WebEngine as described above. In case of Ielig:Web is no patch needed.

2 Likes

I’ll try to poke this later this week.

2 Likes