-
Notifications
You must be signed in to change notification settings - Fork 1
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
LiTeX should work with Xpdf utils as well as Poppler utils #12
Comments
I can't claim to be too surprised at this -- I haven't done any testing To make sure that I understand properly: Compiling the latex file The first thing to check is if there are any messages in the Light Then, let's check that pdftoppm is working. On the command line, in If any of this fails, let me know. Otherwise, we'll move on to |
PDF generation is OK. Blank pages are shown in place of the actual content (total number of pages is correct). Looks like the
Without the C:\...\>pdftoppm -f 1 -l 1 -r 72 sample.pdf
pdftoppm version 3.04
Copyright 1996-2014 Glyph & Cog, LLC
Usage: pdftoppm [options] <PDF-file> <PPM-root>
-f <int> : first page to print
-l <int> : last page to print
-r <int> : resolution, in DPI (default is 150)
-mono : generate a monochrome PBM file
-gray : generate a grayscale PGM file
-freetype <string>: enable FreeType font rasterizer: yes, no
-aa <string> : enable font anti-aliasing: yes, no
-aaVector <string>: enable vector anti-aliasing: yes, no
-opw <string> : owner password (for encrypted files)
-upw <string> : user password (for encrypted files)
-q : don't print any messages or errors
-cfg <string> : configuration file to use in place of .xpdfrc
-v : print copyright and version info
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information If you need more info, let me know |
I had been expecting the options to be the same between the Xpdf and Poppler versions of pdftoppm. How silly of me. The bad news is that the Xpdf version of pdftoppm just won't work for us. The good news is that the new version of Xpdf, which you have (and which was quite literally released yesterday!) has a pdftopng command that will work. If you don't mind digging into some clojurescript, try changing lines 215 and 216 of litex-viewer.cjls (in the src/lt/plugins/ folder of the litex package) from (lt.plugins.litex/run-commands [(str "pdftoppm -f " pagenum " -l " pagenum " -r " (* 72 zoom)
" -png \"" (:pdfname @this) "\"")] to (lt.plugins.litex/run-commands [(str "pdftopng -f " pagenum " -l " pagenum " -r " (* 72 zoom)
"\"" (:pdfname @this) "\" -")] After making the change, you'll need to recompile the Javascript. Saving the file should trigger this, and restarting Light Table should load the new version. Alternatively, you can connect to the "Light Table UI" and then execute the changed bit of code with Ctrl-Enter to alter the currently loaded plugin. With a bit of luck, that will work. That said, I wouldn't be surprised to have something else trip us up. Let me know how it goes. |
Thanks for you very quick answer. To make the generation work I had to include the output file base name as a parameter the
We are a step closer to the solution. A bunch of files are generated, eg:
Each image contains the related PDF page rendered, but images do not get displayed in LightTable (I bet the plugin expects different names for generated PNGs). |
Very good to hear. I was worried that I'd have problems with path Litex isn't looking for the PNGs in any files; it's expecting them to Previously, I had been writing the PNGs to files and then reading the |
The command
Dumps binary content in the terminal I tried to change the plugin in the following way
with no luck. |
On Fri, May 30, 2014 at 8:51 AM, Francesco [email protected]
That's what it's supposed to do. Then, Light Table should read that I'll boot over into a Windows partition later today and see if I can |
I think I know what's going wrong. Windows expects everything sent to Apparently, you can convince Windows to treat stdout as a binary Arguably, the fault lies in pdftopng, which dumps binary data to stdout |
I've heard from the Xpdf author that this is indeed a bug in pdftopng. I'll give him a few days to try to fix it before we start considering work-arounds. |
More differences between Poppler and Xpdf: Xpdf doesn't take non-integer resolutions; Poppler does. Xpdf rounds to the nearest pixel when working out the bitmap size; Poppler always rounds up. Fun. |
While we're waiting for Xpdf to patch itself, you might be interested I can't vouch for either of them, but you might be able to get pdftoppm |
Didn't mean to close this. |
No news from Xpdf. I did get a chance to try the poppler utils from alivate.com.au, and they seemed to work correctly. (I don't have a TeX install on my Windows, so I couldn't test the full stack.) If you feel like giving that a try, I'd love to know whether it works. |
It works! Using: poppler.0.26.1_x86.7z |
Fantastic! How did you install the program from the 7z file? I was able to test I'm going to leave this bug open, but re-title it to be about getting |
This also solves the same issues occuring with OS X 10.10 Use $ brew install poppler |
Summary by @rschroll: The Xpdf version of pdftoppm doesn't support the -png flag, but Xpdf does provide a pdftopng command that we could use instead. It currently has problems on Windows, but we should support it as soon as those problems are fixed.
PDF content is not rendered.
Light Table version: 0.6.5 (on Windows 7 x64)
Binary version: 0.8.4
LiTeX version: 0,0.7
pdftoppm version 3.04
The text was updated successfully, but these errors were encountered: