Download it now!
Bug 68099 - Other: error while starting pdf-viewer after pdf-export
Summary: Other: error while starting pdf-viewer after pdf-export
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: Other Windows (All)
: medium minor
Assignee: Maxim Monastirsky
URL:
Whiteboard: BSA target:4.2.0
Keywords:
: 70957 74063 74767 78571 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-14 08:46 UTC by Ingo Belka
Modified: 2014-07-14 11:14 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
image of the error message (75.76 KB, image/jpeg)
2013-08-14 08:46 UTC, Ingo Belka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Belka 2013-08-14 08:46:36 UTC
Created attachment 84045 [details]
image of the error message

Problem description: 

Steps to reproduce:
1. open a document
2. start dialog to export to pdf
3. choose "Show pdf-document after export" (in my german version "PDF-Dokument nach Export anzeigen"
4. click export

Current behavior:
Each _first_ time I try to shown an exported pdf-document I get an error message that the document to show doesn't exist. If I continue my work and do a second export there is no problem to start FoxitReader (in my case).

Expected behavior:
It should work at the first time and only at the second time.

              
Operating System: Windows XP
Version: 4.1.0.4 release
Comment 1 Jean-Baptiste Faure 2013-08-14 12:42:49 UTC
I do not reproduce under Linux (Ubuntu 12.04) with vanilla version 4.1.0.

Best regards. JBF
Comment 2 Maxim Monastirsky 2013-08-14 12:54:52 UTC
Reproducible under Windows 7 (32-bit) with LO 4.1.0.4, when exporting to a new pdf file (not overwriting an existing one).
Comment 3 Kumāra 2013-10-07 10:21:27 UTC
I confirm this for 

View PDF after Export
Comment 4 Kumāra 2013-10-07 10:38:20 UTC
(Sorry for the earlier imcomplete comment.)

I confirm this for 4.1.1.2 on Windows 7 Home Premium 64-bit.

Suspected cause: The command to launch the file happens before the PDF is created.

Suggested solution: Send the command to launch the file only after the PDF is created.
Comment 5 Ingo Belka 2013-10-17 12:05:35 UTC
The behaviour/bug still exists in 
version 4.1.2.3
Build ID: 40b2d7fde7e8d2d7bc5a449dc65df4d08a7dd38.
Comment 6 Maxim Monastirsky 2013-10-28 16:00:17 UTC
*** Bug 70957 has been marked as a duplicate of this bug. ***
Comment 7 Maxim Monastirsky 2013-11-01 11:46:26 UTC
Indeed, LO calls PDF viewer before the file is actually created. It's even worse - LO first creates the pdf as a temp file, then it copies it to a second temp file (and then attempts to open the file with the final path - which is still not created) and only afterwards copies it to the final path. I thinks that it doesn't make trouble on Linux, as launching the PDF viewer takes time, so LO has a chance to write the file. But on Windows the ShellExecute* function fails when the file doesn't exist, and it's not starting the PDF viewer at all.
Comment 8 Commit Notification 2013-11-04 14:08:40 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7722a5906d8f6765395205f5074f480ad365aa19

fdo#68099 Move pdf viewer call to GUI related code



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Maxim Monastirsky 2014-01-27 20:25:26 UTC
*** Bug 74063 has been marked as a duplicate of this bug. ***
Comment 10 Maxim Monastirsky 2014-02-10 09:38:00 UTC
*** Bug 74767 has been marked as a duplicate of this bug. ***
Comment 11 bugquestcontri 2014-05-22 04:50:05 UTC
Thanks for the fix!
Comment 12 Ingo Belka 2014-05-22 08:17:47 UTC
Hello,

thank you for fixing this little bug. Now it works like expected.
Comment 13 Maxim Monastirsky 2014-07-14 11:14:11 UTC
*** Bug 78571 has been marked as a duplicate of this bug. ***