txt2pdf is a very flexible and powerful PERL5 program.
It's a converter from text files to PDF format files.
With 2.x family you can put your text on white PDF pages.
With 3.x you can create a layer beneath and above your text (background,
foreground), where you can insert phrases or designs (using PDF syntax)
- Most of your documents are text files
- Usually, your reports from legacy applications, DBs, ERP applications,
datawarehouse are textual
- txt2pdf is a PERL5 tool, so you can use it in every OS
supported by PERL5 (View the list of OS tested )
- txt2pdf is a native converter, you don't need to pass through PostScript
format
- txt2pdf is specific for text to PDF conversion, so
- you can mark yellow, red, green, blue or bold, italic, bolditalic (with PERL regular
expression) words in the produced PDF files
- you can produce a 2-columns PDF
- you can add page number in every page
- you can add text at the beginning and at the end of every file
- you can add a border to every page
- every word like http://... ftp://... mailto:... https://... file:... ldap:... news:... will become an URL
- you can create a link to a specific page within a PDF document http://...pdfdocument#pdfmark
Read this good documentation
- every word like mime:... will become a link that launch the correct
application and opens the file
- you can use a few parse commands (e.g. [!blue]...[!/blue])
- you can use background and foreground layers
- every predefined encodings (WinAnsiEncoding, MacRomanEncoding, MacExpertEncoding,
PDFDocEncoding) supported inside the PDF format is supported
+ the Unix default
- txt2pdf supports STDIN and STDOUT
- the fee for every installation is $55
- SANFACE Software is going to give you a free licence for every good idea or
for every good modify
txt2pdf is shareware
The txt2pdf source code is our company core business.
We trust you.
You can freely redistribute (without modify it) txt2pdf tool in its unregistered
archive format (zip or tar.gz)
You can test text2pdf and modify it.
We'll send you a free registered copy for a good idea or txt2pdf modify.
You can't use a modify version of txt2pdf for production purpose.
You can't resell txt2pdf or a modify version of it without SANFACE Software
authorization.
You can't copy part of it to include in your source without SANFACE Software
authorization.
You can get the txt2pdf source code from www.pdfstore.com, too
If you need Mac hqx archive format you can find it at every
Tucows Mac site.
If you need the RPM packadge you can find the version generated by
Rufus T Firefly at
https//www.idrive.com/sanface
We like PERL and we distribute txt2pdf in perl source
Probably you don't like it or you don't want to install it or ...
At etxt2pdf page (etxt2pdf mean Executable txt2pdf) you'll find
the Windows version and now also the Linux and the Solaris executable version.
We can also create executable for BSDOS, IRIX, HP-UX, AIX, and FreeBSD but we can't test them.
txt2pdf 3.4 is shareware. The registration fee is $55 (US) every installation.
Buy five licences or more and save $15 every licence ($40)!
Description | Payment Options |
|
SECURE MasterCard, VISA,American Express, Check, Fax, Voice |
You can buy it also at PDFStore!
The upgrade from txt2pdf 2.5 to txt2pdf 3.x is only $25 (US) every installation (for every licence
registered before 1st January 2000).
txt2pdf 2.5 is shareware. The registration fee is $25 (US) every installation.
Buy five licences packet, one is free!
Description | Payment Options |
One licence
|
|
Five licences
|
SECURE MasterCard, VISA,American Express, Check, Fax, Voice |
If you want to register 10 o more licences contact
SANFACE Software.
Remember: SANFACE Software is going to give you a free licence for every
good idea or for every good modify.
txt2pdf is a PERL script.
We use inside our code the correct method like suggested by the nice article
Year 2000 Compliance
See the example:
$then = time() + ( 60 * 60 * 24 * 365 * 5 ); # 5 years from now
$that_year = localtime($then) -> year;
printf("It shall be 19%d\n", $that_year); # WRONG! 19103
printf("It shall be %d\n", 1900 + $that_year); # right: 2003
-
Create your personal txt2pdf.cfg file.
You can change the value of tmpdir, author, creator,
keywords, subject, title, paper, landscape,
font, cols, lines, tab, pointSize,
vertSpace, yellow, red, green, blue,
bold, italic, bo_it, columns2, npage,
border, allowinparse, beginfile, endfile,
bgdesign, fgdesign, transition, pagemode,
pagelayout and typencoding variables.
With tmpdir you can set the directory for the temporary files.
You can use relative and absolute path. Default is ./
It's better if you use the specific temporary directory of your system
e.g. /tmp/ on UNIX systems
/temp/ on Windows systems
/desktop folder/temp on MacOS
/sys$scratch/ or SYS$SCRATCH on OpenVMS
With author, creator, keywords, subject,
title you can set the relative fields of PDF Info dictionary
that provides information about the document.
Author | The name of the person who created the document |
Creator | If the document was converted into a PDF document from another form, this is the name of the application that created the original document |
Keywords | Keywords associated with the document |
Subject | The subject of the document |
Title | The document's title |
If the value of author, creator, keywords, subject is not
known there are omitted.
If the value of title is null, the file name is introduced.
The default paper value is letter. You can use also A3
(or a3), A4 (or a3), A5 (or a5), tabloid, ledger, legal, statement, executive,
widthxheight
Default is portrait, if you want to swap to landscape you have to set
landscape variable to 1 (Default 0).
With cols you can set max chars per output line (default 80)
With lines you can set max lines per output page (default
(pageHeight-72)/vertSpace, pageHeight depends from paper select)
With tab you can set the number of white space char for every tab
(default 8)
The default font value is Courier. You can use also
Helvetica or Times
With pointSize you can set the font point size (default 10)
vertSpace is the distance between two lines (default 12)
With yellow, red, green, blue you can set a
file where you can list words you want to be colored yellow, red, green,
blue in PDF output file.
With bold, italic and bo_it you can set a file where you can list
words you want to be marked bold, italic or bolditalic in PDF output file.
Setting columns2 : 1 you can configure the conversion to 2-columns
PDF files.
Setting npage : 1 you can add page number in every page
Setting border : 1 you can add a border in every page
With transition variable you can use these parameters:
- split!H!I! two lines sweep across revealing the new page
image. The lines are Horizontal and move from the edge In
- split!H!O! two lines sweep across revealing the new page
image. The lines are Horizontal and move from the center Out
- split!V!I! two lines sweep across revealing the new page
image. The lines are Vertical and move from the edge In
- split!V!O! two lines sweep across revealing the new page
image. The lines are Vertical and move from the center Out
- blinds!H! mulitple lines, evenly distributed across the screen,
appear and synchronously sweep in the same direction to reveal the new
page. The Vertcial lines move down
- blinds!V! mulitple lines, evenly distributed across the screen,
appear and synchronously sweep in the same direction to reveal the new
page. The Horizontalal lines move to the right
- box!I! a box from the edges Inward revealing the new page
image
- box!O! a box from the center Out revealing the new page
image
- wipe!0! a single line sweeps across the screen from one edge to
the other, revealing the new page
- wipe!90! a single line sweeps across the screen from one edge to
the other, revealing the new page
- wipe!180! a single line sweeps across the screen from one edge to
the other, revealing the new page
- wipe!270! a single line sweeps across the screen from one edge to
the other, revealing the new page
- dissolve the old image dissolves in a piecemeal fashion to
reveal the new page
- glitter!0! similar to dissolve, except the effect sweeps across
the image in a wide band moving from one side of the screen to the other
- glitter!270! similar to dissolve, except the effect sweeps across
the image in a wide band moving from one side of the screen to the other
- glitter!315! similar to dissolve, except the effect sweeps across
the image in a wide band moving from one side of the screen to the other
Note: PDF format supports only the described transition values
Setting allowinparse : 1 you can allow the parse
With beginfile and endfile you can set a file where you can
add the text you want to be added at the beginning or at the end of every
file.
With bgdesign and fgdesign you can set a background or foreground
file. Inside you can use directly PDF syntax.
Setting pagemode : FullScreen the Acrobat Reader will open your document
in full-screen mode. In full-screen mode, there is no menu bar, window controls,
nor any other window present.
The default pagelayout value is single page. You can use OneColumn
(Display the pages in one column), TwoColumnLeft (Display the pages in two
columns, with odd-numbered pages on the left), TwoColumnRight (Display the
pages in two columns, with odd-numbered pages on the right)
With typeencoding you can select the correct encoding for your OS:
WinAnsiEncoding, MacRomanEncoding, MacExpertEncoding, PDFDocEncoding are
supported. The default is for Unix
-
How to configure yellow, red, green, blue and
bold, italic, bo_it files.
In these files you can insert a word list with PERL regular expression
rules.
e.g. if you introduce in red.cfg the word end, every word in the
input file what contains end will become red in PDF output file.
If you introduce ^end$, only the end word will become red.
-
Inside beginfile and endfile files you can use the a few markers that you
can enable with the option allowinparse.
This is the list
- [!yellow]...[!/yellow]
- [!red]...[!/red]
- [!green]...[!/green]
- [!blue]...[!/blue]
- [!bold]...[!/bold]
- [!italic]...[!/italic]
- [!bo_it]...[!/bo_it]
You can insert one inside another e.g.
[!red] [!italic] Red italic begin file [!/italic] [!/red]
Remember:
- every word must be separated by one or more blank
- the marks are linear marks, not multilinear
-
Inside bgdesign and fgdesign files you can use directly the
PDF syntax to design and to write
These are a few examples:
If you want to put on every generated page a bold big diagonal DRAFT,
you can use the foreground file with
/F3 55 Tf
.5 .5 -.5 .5 150 455 Tm
(DRAFT) Tj
/F1 means use the selected font in normal way, /F2 italic, /F3 bold,
/F4 bolditalic
55 is the point size.
The meaning of the first line is: use the bold selected font with point
size 55.
The meaning of the second line is: start form point (150,455) and write
diagonal.
The meaning of the third line is: write DRAFT.
If you want to design like background a border line black inside grey,
you can use the background file with
.9 g
0 G
3 w
25 25 545 792 re
B
The meaning of the first line is: inside the rectangle use grey
(0 is black, 1 is white)
The meaning of the second line is: the line is black
The meaning of the third line is: the width of the line is 3
The meaning of the fourth line is: the rectangle is (25,25) (545,792)
The meaning of the fiveth line is: design
You can find the information about the PDF syntax you can use in the
layers directly in
The PDF Reference Manual Version 1.3
(518 pages, ~5 Mb) in the Chapter 8 (Page Descriptions).
-
Try to start txt2pdf. Enter in Tests directory and digit:
../txt2pdf -c test.cfg test.txt
test.pdf is the PDF output file
On Unix OS, a simple STDIN and STOUT test is
ls -l | txt2pdf - > ls.pdf
On Windows OS
dir | perl txt2pdf - > dir.pdf
txt2pdf [-options] files
where options include:
-help print out this message
-configure file default txt2pdf.cfg
-landscape
-2 format in 2 columns
-paper format default letter, valid formats: A3 (or a3),
A4 (or a4), A5 (or a5), widthxheight
-npage add page number
-recursive directory scan recursively the directory
-match files match different files ex. *.pdf, a?.*
(require -recursive option)
-border border line
-allowinparse parser
-verbose verbose
- use STDIN and STOUT
list:
with list you can use metacharacters and relative and absolute path name
- -configure filename: with this option you can configure an alternate
configuration file (the default configuration file is txt2pdf.cfg, located in
txt2pdf directory). This option is very useful if you use txt2pdf in a
automatic task (e.g. cron).
e.g.
txt2pdf -c c.cfg *.c
txt2pdf -c perl.cfg *.pl *.pm
- -match files -recursive directory: with these option you can convert
all the files in the directory and in every its subdirectories
e.g
txt2pdf -m "a*.txt" -r .
to convert every file beginning with a and with txt extension to PDF inside the
. directory and in every its subdirectories
- Every file of the list is converted in a PDF file. If the file has an
extension the extension is changed with .pdf extension, if the file doesn't
have an extension the .pdf extension is added.
- If the line in the input file is longer than the cols number, the
words after are put in the next line. The word on cols number isn't divided
and it is put in the next line.
- ASCII 8 chars are converted using ISO Latin1 Encoding
- CreationDate (The date the document was created) in Info dictionary is
automatically set
- The automatic convertion of words like http://... ftp://... mailto:... https://...
file:... ldap:... news:... to URLs or like mime:... will to a link that launch the correct
application and opens the file
- POD documentation inside
- txt2pdf is able to handle ascii or latin1 documents formatted for
typewriter-like devices.
These texts (as e.g. produced by "groff -Tlatin1") contain bold characters
represented by the sequence 'CHARACTER BACKSPACE CHARACTER' and italics
using the sequence '_ BACKSPACE CHARACTER'.
Reverse ('ESC-7') and half reverse ('ESC-8') line feeds are unusual but
could appear in rare cases. They should be removed prior to processing
with txt2pdf.
A system manager can install txt2pdf and provide a default .cfg file for his
users/organization
setenv TXT2PDFCFG /wherever/default.cfg |
Unix in csh.cshrc for example |
define/system TXT2PDF wherever:default.cfg |
VMS in SYLOGIN.COM for example |
A user can still overwrite the value using another setenv or
define command in his own .cshrc/login.com if he wants to have a default
file of his own.
A user can still have a working directory with a txt2pdf.cfg file and have
it loaded if exists. This allows him (without command line option) to setup
fully functional working directories.
He can also (as he wishes) use the -configure option to overwrite
any defaults.
Read the Cyrillic note in the contributed directory from
Ilya Naumov.
Probably in the same way txt2pdf can work also with Greek, ...
Write us about your tests with txt2pdf
and multilanguage! We'll give you a free licence for every important information
We're looking for contributed frontends: Java, GTK, pTK, VB.
Text-Flowchart is 'ASCII Flowchart maker' perl module created by
Jim Thomason. You can find it in contributed
directory or at CPAN.
See this text Flowchart and its
PDF convertion via txt2pdf (you can also find these
examples in the Tests/flowchart directory).
- Encoding support: WinAnsiEncoding, MacRomanEncoding,
MacExpertEncoding, PDFDocEncoding and the Unix default
- Cyrillic note in the contributed directory from
Ilya Naumov
Here you can find an exhaustive history file