New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hidden failure mode for pdftops when outputting to eps #137
Comments
@michaelpacer - thanks for taking the trouble and time to write this detailed description. Mighty nice of you. For the benefit of others who might not stumble on this Github issue webpage, can you think of a way to fix Alternatively, if you let me know exactly which line croaks in Let me know please. |
So it's not that a line croaks so much as it doesn't send back up the full error, making it even harder to debug, and that error was being hidden inside I think it was that the
except it was not even bothering to load from |
It may just be that you need to catch this error, and instead of piping it through to the while 1
errMsg = 'Pdftops not found. Please locate the program, or install xpdf-tools from ';
url = 'http://foolabs.com/xpdf';
fprintf(2, '%s\n', [errMsg '<a href="matlab:web(''-browser'',''' url ''');">' url '</a>']);
⋮ you tell them that even if they have |
…); improved error presentation; added sample usage in help section
done |
@mpacer Thank you! It works like a charm. |
Sir, could anyone explain what shall I do if I get error137? I didn't understand what shall I do to avoid it? |
@YaduNa - you need to ensure that the
|
Thank you for your reply.
When I used the link from matlab website, I am able to download xpdfreader.
I can't find the the mentioned file in it. What's my mistake?
Sincerely,
Yadu Narendran
…On Fri, Nov 30, 2018, 7:39 PM Yair Altman ***@***.***> wrote:
@YaduNa <https://github.com/YaduNa> - you need to ensure that the
libfreetype.6.dylib file in your pdftops folder is copied over to
Matlab's folder, replacing Matlab's version For example:
sudo scp /usr/local/lib/libfreetype.6.dylib
/Applications/MATLAB_R2016a.app/bin/maci64/libfreetype.6.dylib
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArT_ceD3T2sCIT_TSnLyOs9S8jnMHeJlks5u0TwNgaJpZM4IAoMn>
.
|
Same as the previous comment. I could not find a libfreetype.6.dylib on Windows machine. Any solution would be helpful to try. Thanks, |
@Irismoon - *.dylib is a MacOS file, not a Windows file. You need to install the "Xpdf command line tools" from https://www.xpdfreader.com/download.html |
@altmany I indeed install the cmd tools. But it still does not work. Cmd tools consists of pdftops.exe. As I said in last post, I have pdftops.exe. But matlab could not find it even if I guide matlab to locate it at the right folder. It just shadow it. Not sure if I need install qt, freetype, zlib, etc. At the bottom of the xpdf download page, it says that xpdf reply on those packages. But the link are directed to linux files. |
@Irismoon did you figure out a solution? I'm also getting the errors. |
This took a while to track down, so I thought I'd put it here. I'm new to this package so I can't really submit a PR without spending more time with it & learning how its structured.
tldr; The Matlab2015b version of
libfreetype.6.dylib
is masking the system one, breaking eps output.Use
otool -L /usr/local/lib/libfreetype.6.dylib
to make sure that your local version is 19.0.0 or greater. And then copy that into the MATLAB location:sudo scp /usr/local/lib/libfreetype.6.dylib /Applications/MATLAB_R2015b.app/bin/maci64/libfreetype.6.dylib
. This should fix things for you.Things to note:
-depsc
.Error & debugging walkthrough:
Thought I'd walk through all the various steps along the way, so that when others search the web for this issue (if it isn't fixed) it has a chance of actually turning up their errors. Also it shows a
So, originally, I got the error saying I didn't have
pdftops
, and I didn't so Ibrew
ed it (I'm on OSX). Or rather I triedbrew install xpdf
, and was told I needed to firstbrew tap homebrew/x11
, which then gave access toxpdf
, making the originalbrew install xpdf
command work.Ran into issues there with a conflict with
poppler
, but that was easy enough to solve by unlinking.However, then I kept getting the error popup inside Matlab. Eventually I got into full debug mode to try to figure it out and needed to set breakpoints many levels deep to find the right system state (i.e., the
path_
variable that is passed tocheck_xpdf_path
) after which I ran into the errorreturning
"/usr/local/bin/pdftops" -h: Trace/breakpoint trap
Which made no sense to me. Diving into
check_xpdf_path
I saw that this is the command that was erring:system(sprintf('"%s" -h', path_))
Running that on the matlab command line returned:
At which point I started writing this issue thinking I'd nearly solved it and wanting to be a good package citizen.
But wait! Little did I know that figuring out what was going on with
libreetype
was going to be a mess on its own. So I had a lot of difficulty finding any online documentation aboutlibfreetype
as one ofpdftops
's dependencies. And while I was at it… I tried to justbrew upgrade freetype
I was told it had the newest version…no diceSo the next attempt was to rebuild
xquartz
to the version that was released in November 2015, presuming thatpdftops
was relying on a newer version of thefreetype
library… I then read through this Automattic/node-canvas#471 set of issues, and didn't have any luck. On both theopt
andusr
directorylibfreetype
s when I usedotool
I was gettingSo I was a little befuddled.
And then I looked at that again. Used the
sudo
find command…and lo and behold, the first return tosudo find / -name libfreetype.6.dylib
was:suspicious that there might be some kind of masking going on I tried the
otool -L /Applications/MATLAB_R2015b.app/bin/maci64/libfreetype.6.dylib
line, and yep:so … it was a matter of copying over the
libfreetype.6.dylib
file to the Matlab location and it all worked(sudo scp /usr/local/lib/libfreetype.6.dylib /Applications/MATLAB_R2015b.app/bin/maci64/libfreetype.6.dylib
). I figured this approach would be better than fighting with Matlab's path search order.The text was updated successfully, but these errors were encountered: