plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
MIT License
378 stars 39 forks source link

Problems with detecting pdftops.exe #154

Closed GijsvandenHoven closed 4 months ago

GijsvandenHoven commented 1 year ago

Hi,

I've been trying to generate eps files through Plotly (on a Windows machine).

To do this, poppler must be installed, and added to the PATH. I did both of these, but the results stay the same.

Specifically, by modifying plotly to add some prints, I find that Kaleido returns 530: Exporting to EPS format requires the pdftops command(...), which makes sense if poppler can't be found, and seems to be created from the format == "eps" && !popplerAvailable condition in kaleido.cc.

Looking deeper, for Windows devices, popplerAvailable is set in bool ExecutableExistsInPath, also in kaleido.cc. This function will check if pdftops.exe is an existing file by appending it to any pathspec in the PATH variable.

What has me defeated is that this really should work, but this function still seems to decide no such executable can be found.

For example, if I ask Windows to find it in the path for me, both 'where' and just entering the executable are successful!. This even made me realize I already had pdftops available in a different binary folder the whole time before installing poppler. I was also able to subprocess.Popen pdftops myself, with only specifying pdftops.exe in Python.

My only remaining guesses are

1) Somehow GetVar("PATH") is failing and returning false, even though I can't seem to find any Error logs anywhere confirming this (nothing on stderr or stdout on plotly's end) 2) The code that forms the executable path has something going strangely 3) GetVar or Append or something else from chromium is doing something unexpected

I briefly suspected (2), out of misunderstanding file.Append. Either way, I tried setting my path to poppler's bin both with and without a trailing \, with the same result either way.

I have also tried moving poppler's executable from Program Files to Documents where it is now, to get rid of spaces in my path name. I have also attempted to run with removing the second path (texlive) just in case.

For reference, this is the snippet of strings in 'Path' that points to poppler. This is under 'System Variables'.

There is also C:\texlive\2022\bin\win32 in Path under User Variables, which theoretically could be a detectable pdftops.exe as well?

Is there any chance in the world you have an intuition what is going on here? Maybe seen this before? I would be most grateful.

Thank you for your time.

gvwilson commented 4 months ago

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson