Le 27/06/2017 à 11:26, Tim Hutt a écrit :
After having Lyx on OSX fail to load PDF previews for the Nth time the
thought occurs that relying on third party command line tools like
ImageMagick and Ghostscript, or even sips (which I believe is the
'fix') is horribly fragile and there is a better way.

Why not integrate Pdfium into Lyx? It's open source with a
non-restrictive license. Battle tested. You're never going to have
issues with commands changing their name or not being in the PATH or
whatever.

Plus it opens up new opportunities, e.g. an integrated render preview,
faster native resolution graphics previews, etc.

LyX uses the unix philosophy: do what we know how to, let other programs do the rest. For graphics, it means that:
* whatever is handled natively by Qt (e.g. svg) can be used directly
* the rest is done via external programs, that can be chained through our formats/converter system

The good news is that Qt people have been working on a PDFium wrapper
http://blog.qt.io/blog/2017/01/30/new-qtpdf-qtlabs-module/
and that native PDF rendering will eventually happen.

Now, there are tons of other PDF libraries, and it is probably an error to believe that something is better than sliced bread because the magic "google" word is written on it :)

But basically, what we want is, given a PDF file, to convert it to png or whatever and load it. Since we are not interested in interaction with the PDF file, I doubt that a library will really help us.

Concerning the actual macOS problem: can you describe a bit more what happens? I have to admit that the preview mechanism is a bit of a mystery to me. I suspect in particular that it still relies on dvi output.

Reply via email to