Project

txt2pdf

0.0
No release in over 3 years
Low commit activity in last 3 years
Reads a text file (if supplied as the first argument) and creates a pdf file with the same name but with .pdf as extension in the current directory via the program pdflatex (the only requirement besides ruby itself). If '-h' is the first argument, then the program displays the helptext and exits. The program can also read the input text from STDIN (STanDard IN) and create the pdf file in the user's home directory. When this method is used, no argument is given to the program and the text is simply piped directly into the program like this: $ echo 'Hello' | txt2pdf This would create a pdf file with only 'Hello' and the page number at the bottom of the resulting pdf page. With this, you could map a key binding in your window manager to create a pdf file from the text you selected in any program, be it the terminal, your browser or your text editor. In my wm of choice, i3, I have added the following to my i3 config: bindsym $mod+p exec xclip -o | txt2pdf This would create a pdf file from the text I have selected as I hit the 'Window Button' and 'p'.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

txt2pdf

Converts plain text (file or from STDIN) to pdf via pdflatex

SYNOPSIS

txt2pdf [-h] (filename)

DESCRIPTION

Reads a text file (if supplied as the first argument) and creates a pdf file with the same name but with .pdf as extension in the current directory via the program pdflatex (the only requirement besides ruby itself). If "-h" is the first argument, then the program displays the helptext and exits.

The program can also read the input text from STDIN (STanDard IN) and create the pdf file in the user's home directory. When this method is used, no argument is given to the program and the text is simply piped directly into the program like this:

  $ echo "Hello" | txt2pdf

This would create a pdf file with only "Hello" and the page number at the bottom of the resulting pdf page.

With this, you could map a key binding in your window manager to create a pdf file from the text you selected in any program, be it the terminal, your browser or your text editor. In my wm of choice, i3, I have added the following to my i3 config:

  bindsym $mod+p exec xclip -o | txt2pdf

This would create a pdf file from the text I have selected as I hit the "Window button" and "p".

OPTIONS

-h Show this help text

COPYRIGHT

By Geir Isene (https://isene.org) 2019. No rights reserved.