mailcap entry for handling pdf's and seems to be performing its function well. A path to the script above has been added to my. One of the tabs will always have elinks running in it and it will function as a window where I can open e-mail attachments such as pdf's, read man pages, or just open web pages. Like that author, I am often interacting with one of my computers via the command line in an ssh session in which I am running tmux. In closing, the inspiration for this project of attempting to use elinks as a pager, comes from this page: Pdftohtml -i $pdfname /tmp/pdfs2html/$numberplus.html & elinks -remote /tmp/pdfs2html/$numberplus.html # increment by one the highest numbered file found # if the directory is not empty, find the highest numbered file in /tmp/pdfs2html Pdftohtml -i $pdfname /tmp/pdfs2html/1.html & elinks -remote /tmp/pdfs2html/1.html # test whether the target directory is empty and, if it is, convert the supplied pdf under the name 1.html # read the name of the pdf supplied to this script into a variable As may also be clear, if one's system is not set up to automatically clear contents of the /tmp directory on reboot, the directory to which the transitional html files are being written will need to be emptied (say, by using a cron script) periodically. As will be apparent, I decided that assigning numerals rather than names to the converted transitional html files would provide an automated way of assigning unique names. It's not really a good resolution because when I try to reload any other tab that might previously have been opened to the transitional page/file, the most recent copy of that page/file will be loaded, not the one that had been previously opened.Ĭompounding with further kludges, here's a commentated bash script (which I am calling pdf2elinks) I cobbled together, using my modest powers as an internet searcher and my expertise as an elite copy/paster, that addresses the issue of transitional html files produced by pdftohtml being overwritten by subsequent files and thus lost before adequate review. Reloading the page is required so that any other transitional open page/file the browser might have previously cached is not displayed. That creates a transitional file(s) in the /tmp directory that proves acceptable to the -remote switch. Pdftohtml -i file.pdf /tmp/pdf.html & elinks -remote /tmp/pdf.html & elinks -remote "reload()" The kludge I've so far gotten to approximate what I'm aiming for is Although something like pdftohtml -i file.pdf my-pipe & elinks way this works, using as an example a URL instead of the output of a command, is as follows: starting elinks in one terminal, then running a command like elinks -remote in another terminal, will result in a new tab being opened in the running elinks instance displaying the google search page. I want to use elinks' -remote switch to cause the output from the pdftohtml command to be sent to a new tab in an already-running instance of elinks. What I'm hoping to do though, is a slight variation on this. As should be clear, what's happening is that file.pdf is being converted to html and then piped to the text-mode browser elinks for display. The following command works great to view pdf content from the command line: pdftohtml -i -stdout file.pdf |elinks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |