intellij-pdf-viewer icon indicating copy to clipboard operation
intellij-pdf-viewer copied to clipboard

pdf 404 not found when the file path has special characters (&, #, =)

Open zhou7507 opened this issue 2 years ago • 15 comments
trafficstars

when I use split and move right on the pdf in goland, it will show 404 not found

zhou7507 avatar Jul 05 '23 09:07 zhou7507

It works fine for me in goland. You mean if you open a pdf when there is only one tab group, and then right-click and click and select 'Split and move right', then it will show a 404? Can you provide a screencast of that? What version of the plugin are you using?

PHPirates avatar Jul 05 '23 09:07 PHPirates

yes , plugin version is 0.15.0. goland is 2022.3.2 sp20230707_105258_092

zhou7507 avatar Jul 07 '23 02:07 zhou7507

then ,I try to open another pdf ,it also show 404 not found It didn't work until I restarted the goland. image

zhou7507 avatar Jul 07 '23 03:07 zhou7507

Interesting, I still can't reproduce the issue. Does it work in IntelliJ? What operating system are you using? Do you have any special characters in the project name like in #29? Could you upload idea.log? Help > Show log in explorer

PHPirates avatar Jul 07 '23 08:07 PHPirates

I only use goland, so I don't know if it works in IntelliJ my operating system is windows 11. my project name like D:\ProgramData\a_b\c-d-e. Attached is the log log.txt

zhou7507 avatar Jul 07 '23 09:07 zhou7507

I modify my project named D:\ProgramData\a\b, but it also doesn't work

zhou7507 avatar Jul 07 '23 09:07 zhou7507

Many thanks for your help. Unfortunately I still have no idea what's causing this. I cannot reproduce the issue with GoLand 2022.3.4 on Windows. I suspect we need to improve logging in the plugin to figure out cases like this. If you ever find out more cases where it works or doesn't work, let us know.

PHPirates avatar Jul 08 '23 16:07 PHPirates

I'm also getting the 404 Not Found error. Before that, I did get a message that said the PDF was missing.

Screenshot 2023-12-19 142403

snbudzisz avatar Dec 19 '23 19:12 snbudzisz

@snbudzisz What is your operating system, IDE and plugin version? Can you reproduce the problem in a different/new project?

PHPirates avatar Dec 19 '23 20:12 PHPirates

I have Windows 11 Home, IntelliJ IDEA Ultimate 2023.3.2, and PDF Viewer plugin version 0.15.0.

It did work for a new project. It seems that IntelliJ was having issues writing the out folder in my LaTex project. I had a directory in the path that included an & in the name. I renamed that file folder to remove the ampersand, and it's now working.

snbudzisz avatar Dec 26 '23 19:12 snbudzisz

Thanks! Then I suspect this issue is a duplicate of #29 after all

PHPirates avatar Dec 28 '23 18:12 PHPirates

I have also encountered this problem. Is there any solution?

jhzgjhzg avatar Jan 10 '24 07:01 jhzgjhzg

@jhzgjhzg Yes, make sure you don't have any special characters like & (or Chinese characters?) in the project path and pdf path and it should work fine

PHPirates avatar Jan 12 '24 07:01 PHPirates

I've been able to recreate this problem. The path I'm using is,

C:\OneDrive\OneDrive - Abcdefghi Asdfghj Mnbvcx\Documents\PyCharmProjects\ABC_DEF\ghij_decomposition_N=8.pdf

where I've obfuscated the filename slightly for privacy reasons (but only insofar as replacing words with random strings of the same length).

I can't change the fact there are spaces in my filename, because that's the directory OneDrive chose for me (it's an enterprise OneDrive).

jaredjeya avatar Jan 31 '24 15:01 jaredjeya

@jaredjeya Thanks for the path, I can confirm that = characters are also an issue. If you remove that one from the file name and restart the IDE then it should work again. Spaces should be no problem (though OneDrive might be a problem, not sure)

PHPirates avatar Feb 01 '24 18:02 PHPirates

Does this relate to https://github.com/FirstTimeInForever/intellij-pdf-viewer/pull/110?

Help -> Diagnostic Tools -> Debug Log Settings, then input:

com.firsttimeinforever.intellij.pdf.viewer.jcef.PdfStaticServer

Then Help -> Show Log in ...., you can check the log file.

liudongmiao avatar Sep 02 '24 00:09 liudongmiao

@liudongmiao I thought about that as well, but I tested after your changes and the issue remains. I just tested again with 19e5c508f4b26bcab2f0fc1fdbd7036f46b7c826 (which was not merged) and that does appear to fix the issue with = and & but not with #. Interestingly, when I open a file in firefox then = will remain in the url but # will be encoded to %23 before opening, so maybe further encoding is required? @slideclimb Do you have any more information on what you tried?

PHPirates avatar Sep 09 '24 06:09 PHPirates

Please check the artifacts plugin https://github.com/FirstTimeInForever/intellij-pdf-viewer/pull/112/checks

I have checked with name pdftest - _ . ! ~ * ' ( ) ; ? : @ & = + $ , # [ ] ✨.pdf on macOS.

liudongmiao avatar Sep 11 '24 02:09 liudongmiao