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
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.
Created attachment 140082 [details] document properties.
Created attachment 140083 [details] print preview
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
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? :)
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).
Created attachment 140112 [details] bug-print-to-pdf
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)
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 :)