Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 19 Aug 2017, 20:51
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
text2pdf
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
goingnuts

Joined: 07 Dec 2008
Posts: 889

PostPosted: Sat 11 Feb 2017, 12:02    Post subject:  text2pdf  

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.
text2pdf-1.1.tar.gz
Description  source and static linked bin
gz

 Download 
Filename  text2pdf-1.1.tar.gz 
Filesize  27.72 KB 
Downloaded  47 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Sailor Enceladus

Joined: 22 Feb 2016
Posts: 1203

PostPosted: Sat 11 Feb 2017, 12:19    Post subject:  

Thanks goingnuts. Tested the bin in Slacko 5.7 and it worked without having to compile it. Smile
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 1421
Location: The other Mr. 305

PostPosted: Sat 11 Feb 2017, 13:00    Post subject:  

Works but it changed the font drastically on me. I just dragged the text2pdf to the /bin directory and then executed per your instructions.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 889

PostPosted: Sat 11 Feb 2017, 13:30    Post subject:  

Thanks for testing! There are some switches to control output - "text2pdf -h" will show:
Code:
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:
#!/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.
Back to top
View user's profile Send private message Visit poster's website 
OscarTalks


Joined: 05 Feb 2012
Posts: 1568
Location: London, England

PostPosted: Sat 11 Feb 2017, 14:20    Post subject:  

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

Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 889

PostPosted: Sat 11 Feb 2017, 14:45    Post subject:  

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...).
Back to top
View user's profile Send private message Visit poster's website 
slavvo67

Joined: 12 Oct 2012
Posts: 1421
Location: The other Mr. 305

PostPosted: Sat 11 Feb 2017, 15:20    Post subject:  

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, 15:29; edited 2 times in total
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 889

PostPosted: Sat 11 Feb 2017, 15:24    Post subject:  

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.
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 4652
Location: Ontario

PostPosted: Mon 13 Feb 2017, 20:42    Post subject:  

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/viewtopic.php?p=893266#893266

_____________________________________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0985s ][ Queries: 15 (0.0060s) ][ GZIP on ]