Bug 439876 - When setting Okular as default PDF viewer, issue when I double click file.
Summary: When setting Okular as default PDF viewer, issue when I double click file.
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 20.12.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-15 09:16 UTC by Mark James
Modified: 2021-07-17 22:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Okular issue Windows 10 (556.62 KB, image/png)
2021-07-15 09:16 UTC, Mark James
Details
document properties. (7.95 KB, image/png)
2021-07-15 15:02 UTC, Mark James
Details
print preview (4.28 KB, image/png)
2021-07-15 15:02 UTC, Mark James
Details
bug-print-to-pdf (302.15 KB, application/pdf)
2021-07-16 10:34 UTC, Mark James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark James 2021-07-15 09:16:21 UTC
Created attachment 140072 [details]
Okular issue Windows 10

SUMMARY
Whenever I set Okular as my default PDF viewer and open a file, there seems to be a saved 'session' from the last PDF file I opened. This looks like it has cached a screenshot or something and I have added an attachment.

I have tried to delete Okular and reinstall it, but noticed the issue keeps happening - I can get around this by opening Okular and opening the PDF file via the File-Open.

STEPS TO REPRODUCE
1. Set Okular as default PDF viewer on Windows
2. Double click a PDF file
3. Check if this looks like my attachment

OBSERVED RESULT
Have a snippet of the last PDF file which was opened, along with the first page of the new PDF file i've opened.

EXPECTED RESULT
Open the PDF file which was clicked to open.

SOFTWARE/OS VERSIONS
Windows: 10 - 21H1 - 19043.1110
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Laura David Hurka 2021-07-15 11:33:05 UTC
Looks strange, no idea what could cause this.

Have you verified that it is actually a part of the last PDF file you opened? I. e. have you tried to open different PDF files in series, and the first “page” looks different depending on the last file?

Can you look what File -> Properties says? Does it report one page too much for the current document?

Can you look whether the wrong “page” also appears in File -> Print Preview?

>         Component: PDF backend
Have you tried it with different file types? Okular can also open e. g. .txt and .ps and so on.
Comment 2 Mark James 2021-07-15 15:02:26 UTC
Created attachment 140082 [details]
document properties.
Comment 3 Mark James 2021-07-15 15:02:38 UTC
Created attachment 140083 [details]
print preview
Comment 4 Mark James 2021-07-15 15:04:22 UTC
Thanks for the quick reply, i've added two screenshots to show what it does for properties and print preview.

Seems to open text files fine, and doesn't append my last opened PDF to the document.. so no idea how it managed to do it this morning.. 

I'm happy to add any more information if needed, just let me know && obviously everything works perfectly on KDE Neon :P
Comment 5 Laura David Hurka 2021-07-16 10:09:41 UTC
Okay, thanks so far.

How many pages does your file have? 2 or 3?

Does the main view show this weird “page” and then the 3 pages of your document, or 3 pages in total?

The file size of 0B is weird. I assume your document is an ordinary file on your disk, and not something special? (On Linux, you can have “sockets”, which have a file size of 0B but you can read more contents from it. I don’t know whether there is something similar on Windows.)

If Print Preview doesn’t work, is the print dialog (File -> Print) on Windows able to print to a PDF file? Then you could try that, and check the generated file.

In the File -> Properties dialog, can you check the “Page Sizes” tab? Does it list a weird size for the first “page”?

And finally: did you try to open the document in another reader? :)
Comment 6 Mark James 2021-07-16 10:33:51 UTC
Hey David,

I just noticed this only happens when my files are in my 'OneDrive' folder, but are locally available. When the files are say in my Downloads folder it works correctly.

I was able to print the odd bug as a PDF and i'll attach it.

Maybe it's a file path issue with the files being in OneDrive (maybe who knows).
Comment 7 Mark James 2021-07-16 10:34:11 UTC
Created attachment 140112 [details]
bug-print-to-pdf
Comment 8 Laura David Hurka 2021-07-16 11:29:28 UTC
My suspicion is that OneDrive presents a PDF stream which only contains one page to allow creating preview thumbnails efficiently, and only when you actually want to open the file it delivers the correct PDF stream. Okular doesn’t expect that, and simply uses both streams, which results in the one page followed by the actual document.

(I don’t really know how PDF works, but I think this is possible. ;) )

What happens when you reload the file while you have this bug? (File -> Reload)
Comment 9 Mark James 2021-07-16 18:05:25 UTC
Reload doesn't do anything for the weird one - obviously it works on files that work - (Open them via Okular menu).

I don't think it's a massive issue, just thought i'd report a bug :)