text2pdf

Word processors, spreadsheets, presentations, translation, etc.
Post Reply
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

text2pdf

#1 Post by goingnuts »

The program is actually very simple to use. All you normally do is
text2pdf myfile > myfile.pdf.
I found it here and created attached source package in which a static linked bin [40k] is included.
Attachments
text2pdf-1.1.tar.gz
source and static linked bin
(27.72 KiB) Downloaded 186 times

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#2 Post by Sailor Enceladus »

Thanks goingnuts. Tested the bin in Slacko 5.7 and it worked without having to compile it. :)

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#3 Post by slavvo67 »

Works but it changed the font drastically on me. I just dragged the text2pdf to the /bin directory and then executed per your instructions.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#4 Post by goingnuts »

Thanks for testing! There are some switches to control output - "text2pdf -h" will show:

Code: Select all

text2pdf [options] [filename]

  text2pdf makes a 7-bit clean PDF file (version 1.1) from any input file.
  It reads from standard input or a named file, and writes the PDF file
  to standard output.

  There are various options as follows:

  -h            show this message
  -f<font>      use PostScript <font> (must be in standard 14, default: Courier)
  -I            use ISOLatin1Encoding
  -s<size>      use font at given pointsize (default 10)
  -v<dist>      use given line spacing (default 12 points)
  -l<lines>     lines per page (default 60, determined automatically
                if unspecified)
  -c<chars>     maximum characters per line (default 80)
  -t<spaces>    spaces per tab character (default 8)
  -F            ignore formfeed characters (^L)
  -A4           use A4 paper (default Letter)
  -A3           use A3 paper (default Letter)
  -x<width>     independent paper width in points
  -y<height>    independent paper height in points
  -2            format in 2 columns
  -L            landscape mode

  Note that where one variable is implied by two options, the second option
  takes precedence for that variable. (e.g. -A4 -y500)
  In landscape mode, page width and height are simply swapped over before
  formatting, no matter how or when they were defined.
I wanted a really cheap text2pdf-printer for some of my text-editors - so created below script named "lpr" in /bin:

Code: Select all

#!/bin/sh
FILE=$(echo ${@} | cut -d " " -f3)
DESTFILE=$(basename ${FILE})
if [ -f ${FILE} ]; then
	text2pdf ${FILE} > /$HOME/${DESTFILE}.pdf &
else
	echo file not found
fi
exit
Above might not be universal usable - adjust for your own needs.

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#5 Post by OscarTalks »

Thanks goingnuts.
Regarding the fonts, I wonder if it would help (or if it would cause problems) if we change the default font to "DejaVu Sans" (and also the text in the "help" printout) in the source .c file and re-compile?
Oscar in England
Image

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#6 Post by goingnuts »

Changing to "DejaVu Sans" in source will work - but I think "Courier" is more likely to be found on most systems (if font not present you get a blank document out of text2pdf it seems...).

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#7 Post by slavvo67 »

Maybe that's the problem. I didn't include the source .c file when I dragged it into the /bin directory. Do I need to?

Also, I can see where it would be helpful, especially for batch processing but you know Libre-Writer converts to PDF and you can call it via terminal. You can also call ABI Word to do something similar and might, in fact be the best use of the ABI product these days...
Last edited by slavvo67 on Sat 11 Feb 2017, 19:29, edited 2 times in total.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#8 Post by goingnuts »

Only text2pdf needed. The font shown in your editor might be different than the default font used by text2pdf - and that's given the different output.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

Recent versions of mtpaint have a feature where the app lists all the
fonts that are available and the name that the system uses to call them.
I believe it's under the edit menu heading.

It might be useful to look there.


Here is where I selected a font for mtpaint scripting
http://www.murga-linux.com/puppy/viewto ... 266#893266

_____________________________________________________

Post Reply