SANFACE Software: the developer of txt2pdf

txt2pdf (text to pdf)

Software to convert old txt (also IBM codepage 437), spool, text, textual report to nice pdf (form, invoice, report, sale sheet) on Windows, Solaris, Linux HP-UX, AIX, Mac OS X, tru64, openvms, sco, irix, bsd, OS/390, z/OS, AS400, ... Support for Japanese, Chinese (simplified and traditional), Korean, Czech, Greek, Polish, Hebrew, Thai, Cyrillic languages.
Developed by SANFACE Software
Version 11.1 25 April 2017

Important projects based on SANFACE Software Products.

Remember to evaluate also:

  • txt2pdf PRO
    To use in the background jpegs and to create compressed pdfs
  • txt2pdf PRO + crypt
    To create encrypted pdfs and to use in the background pdfs

What is txt2pdf?

txt2pdf is flexible and powerful tool to convert txt, text, textual report, spool into pdf (form, invoice, report, sale sheet).  It can be used alone, or you can use it from other applications to convert your documents on the fly.

Why do you need txt2pdf?

Most of your documents are text files. Usually, your reports from legacy applications, COBOL applications, DBs, ERP applications and datawarehouse are textual. txt2pdf allows you to take those old text files and turn them into PDF's, which means you don't even need to pass the data through PostScript first.

You can run txt2pdf on any system that runs PERL (we have customers that use txt2pdf on OpenVMS, MPE, ...) or you can use a binary version on Windows, Solaris, HP-UX, AIX, Linux, Mac OS X (if you're interested in a binary for another operating system, such as FreeBSD, SCO Unix, Irix, Digital Unix (tru64), please let us know, and we'll send you one).

Here there are some of the things that you can achieve with txt2pdf:

  • Support for Japanese fonts (HeiseiMin-W3-90ms-RKSJ-H and HeiseiKakuGo-W5-90ms-RKSJ-H) normal, italic, bold, bolditalic and Japanese paper formats (JISB4 and JISB5).
    We have set that every ascii chars is just half of a Japanese char. This allows to convert this Japanese text into this pdf!
  • Support for Korean font (HYSMyeongJoStd KSCms-UHC-H) normal, italic, bold, bolditalic.
    We have set that every ascii chars is just half of a Korean char.
  • Support for simplified Chinese font (STSong GB-EUC-H) and traditional Chinese font (PMingLiU ETen-B5-H) normal, italic, bold, bolditalic.
    We have set that every ascii chars is just half of a traditionaland simplified Chinese char. This allows to convert this traditional Chinese text into this pdf!
  • Support for Czech, for Greek, Polish, Hebrew, Thai and Cyrillic. (If you want different languages or different fonts for the supported languages contact us). new
  • Initial support for utf8. At the moment it's possible to encode utf8 into iso8859-1. (if you need other encodings contact us). new
  • txt2pdf supports STDIN and STDOUT.
  • You can mark coloured (using regular expressions) sentences in the produced PDF files.
  • You can mark bold, italic and bold italic sentences in the produced PDFfiles.
  • You can add page numbers on every page.
  • You can add text at the beginning and at the end of every file.
  • You can add a border to every page.
  • You can use background and foreground layers.
  • All predefined encoding (WinAnsiEncoding, MacRomanEncoding, MacExpertEncoding, PDFDocEncoding) supported by the PDF format and the Unix default are supported by txt2pdf.
  • It's possible to run through txt2pdf infinitely (every configured second, sleep feature) on a specific directory (and also its recursive directories) moving the produced PDF to a specific directory, and the original text to a specific directory.
  • mailto (mailcc, mailbcc) options: the possibility to send to the specified users (to, cc, bcc) the created PDF like attach. It's possible to specify the title, the body, the SMTP host, the from user (at the moment you can use these features only with the executable versions).
  • ftp support: the possibility to put the created PDF in the specified ftp site. It's possible to specify user, password and the final directory.
  • Internet specific phrases such as http://... ftp://... mailto:...file:... ldap:... news:... , setting linkuse, will automatically be made into clickable URL's.
  • You can create a link to a specific age within a PDF document just adding http://...pdfdocument#pdfmark
  • Every word like MIME:..., setting linkuse, will automatically become a link that launches the correct application to open that file.
  • A PE (Personal Edition) License is ONLY $59.

Download txt2pdf

txt2pdf is available in several formats so you can download for your convenience.  You may choose to download an executable file or you can just download the perl source code.  Before you download our software, we ask you please to read the license and registration section to be aware of the licensing model which txt2pdf uses.

If you're interested in purchasing txt2pdf, please see the purchasing txt2pdf section.

We like perl, and that's the reason why we distribute txt2pdf primarily. This source code is our core business. We trust you. Please read the license and registration section.

Purchasing, Licensing and Registration

txt2pdf is shareware. That means that you're welcome to try it and use it as much as you want for 30 days. If after that time you like txt2pdf or would like to continue using it, we ask you please to purchase it or remove it from your system.

  • The txt2pdf source code is our company's core business. WE TRUST YOU.
  • You may modify and test txt2pdf, but you may only redistribute the txt2pdf tool in its original unchanged unregistered archive format (zip or tar.gz).
  • You are not allowed to use a modified version of txt2pdf for production purposes. If you wish to use txt2pdf on an ongoing basis, please see purchase out product.
  • You are not allowed to resell txt2pdf or any modified version of txt2pdf without SANFACE Software's authorization.
  • You are not allowed to re-use or include any txt2pdf source code in your own source code without SANFACE Software's authorization.
  • If you're a developer or a software house, and wish to use txt2pdf inside of your own applications, please email us directly at sanface@sanface.com

Only $59 for the Personal Edition
This means that you use the software for Personal purpose (home user, not inside a company).

This is the price for the Enterprise Edition:
$150 (US) for 1 CPU computer + $5 for every phisical core
e.g. 6 phisical core server fee is: $150 + 5 x $5 = $175
If you need a license for a virtual server:
$200 (US) for 1 CPU computer + $5 for every virtual core
Pay attention: if you have a virtual server with 5 virtual machine that runs 5 txt2pdf process, you need 5 txt2pdf licenses (virtual).

You can buy our software at MyCommerce.  To purchase txt2pdf PE (Personal Edition not inside a company):
txt2pdf PE (Personal Edition)

To purchase txt2pdf EE (Enterprise Edition) if you need less than 5 licences use:
txt2pdf E.E. less than 5 license (remember to select the total number of physical cores. e.g. if you need 2 server licenses: one a 4 quad processor server and one a 4 bi processor server you have to add the additional cores: 4x4 - 1 + 4x2 - 1 = 15 + 7 = 22)
txt2pdf E.E. less than 5 license for virtual server (remember to select the total number of cores. e.g. if you need 2 server licenses: one a 4 quad processor server and one a 4 bi processor server you have to add the additional cores: 4x4 - 1 + 4x2 - 1 = 15 + 7 = 22)

Upgrade Policy

  • You can upgrade txt2pdf 8.x, 9.x, 10.x to the new version with the discount of the amount you previously paid + a fix fee for every license:
    • $35 for 10.x
    • $45 for 9.x
    • $60 for 8.x
    For example, if you paid $140 for your 10.x copy of txt2pdf and the new version costs $150, you will only pay $150 - $140 + $35 = $45.
    If you registered a previous release (1.x, 2.x, 3.x, 4.x, 5.x, 6.x, 7x) you have to buy a new license.
    Contact us via email at sanface@sanface.com for more information about how to upgrade your version.

Volume Discount

You can get the following bulk discounts. Remember to contact us to have more information:

PE (Personal Edition)
    5-10 licenses            $54 each
    11 or more licenses      $44 each
EE (Enterprise Edition)
    5-10 licenses            $140 each (no CPU server difference)
    11 or more licenses      $120 each (no CPU server difference)
EE (Enterprise Edition) virtual server
    5-10 licenses            $190 each (no CPU server difference)
    11 or more licenses      $170 each (no CPU server difference)

Reseller Discount

Contact directly us! We're looking for resellers and partnerships.

No limit license

If you have one or more products with several installations and you want to use txt2pdf inside every tool of yours, here there is the license that you're looking for.  It costs $2000 + 20% every year for PE (Personal Edition), $8000 + 20 % every year for EE (Enterprise Edition).  Obviously you will receive free _every_ update.

Annual maintenence fee new

If you want the best support we can give you and the possibility to have in a year the upgrade of every minor and major release, now you can subscribe an annual maintenece fee. The price of annual maintenece fee is 20% of the actual txt2pdf amount. If you are interested ask us how to subscribe the annual maintenece fee.

Getting executable txt2pdf

txt2pdf has been specially compiled for those users who just can't or don't want to run Perl on their systems.  It has all the functionalities of the original perl version, and is distributed only in binary form for your convenience.

We currently have 6 executable versions:

For another operating system, such as FreeBSD, SCO Unix, Irix, Digital Unix (tru64) we suggest to user perl code. If you can't use perl code try to contact us.   Please note that the Windows version comes with an extra tool known as Visual txt2pdf.  We convert using perl2exe.

Installing txt2pdf

  1. Create a directory for txt2pdf (eg. txt2pdf)
  2. Unpack the source file that you downloaded.  For Windows, you can unzip (using eg 7zip) and for Linux and other Unix flavours, you can simply use GNU tar.
  3. Test if the executable perl file works by running the following:
    • ./txt2pdf.pl -h (Linux and other Unix flavours)
    • .\txt2pdf -h (Windows)
  4. Create your first PDF file on the fly by running the following:
    • txt2pdf(.pl) yourfile.txt
  5. The result is yourfile.pdf

Configuration of txt2pdf

txt2pdf uses the file txt2pdf.cfg for its configuration file.  This file must reside in the same directory as the txt2pdf.pl file, since it searches for this file at runtime.  You can create your own txt2pdf.cfg file.  Inside this file, you can change the values for the tmpdir, author, creator, keywords, subject, title, pdfversion, paper, landscape, defaultfont, usedfonts, lines, tab, pointSize, vertSpace, npage, border, beginfile, endfile, bgdesign, fgdesign, transition, pagemode, pagelayout, rotate, typencoding, withextension, colour, fontmark, sleep, pdfdir, txtdir, ViewerPreferences, fit, zoom, list, japanese, tradchinese, simplchinese, korean, pagemark, inputmod, outputmod, prepdf, annotationtext, underline, linkuse and noid variables. Only with the executable versions you can set also mailhost, mailfrom, notify, priority, mailsubject, mailbody, mail_body_file, sendmail, disposition, attachtype, utf8-iso8859-1, ftphost, ftpuser, ftppassword, ftpdirectory

To change any of these values, you just need to edit txt2pdf.cfg.  You can also create a new .cfg file and tell txt2pdf to read it at runtime, using the -configure yourfile.cfg option.  In this section, we will discuss the most widely used variables, the one you are most likely to use with txt2pdf.

With the tmpdir variable, you can specify the default directory to use for temporary files.  You can use relative or absolute path names.  The default directory is ./, but it's better if you specify a specific temporary directory that's in use for your system.

eg.
/tmp/                           on Unix systems
/temp/                          on Windows systems
/desktop folder/temp            on MacOS systems
/sys$scratch/ or SYS$SCRATCH    on OpenVMS
#!ENV#TEMP#!/ENV#               to use TEMP environment variable

The author, creator, keywords, subject and title variables allow you to set the relative fields in the PDF document that provides information about the document.  If these values are not known, then they are just ommited.  If the value of title is null, the file name is used as the default value of title.

Author      The name of the person who created the document
Creator     The name of the application that created the original document
Keywords    Keywords that are associated with the document
Subject     The subject of the document
Title       The title of the document

The default value for pdfversion is 1.2.  You can also use 1.3, 1.4, 1.5.
The default value for paper is letter. You can also use A3 (or a3), A4 (or a4), A5 (or a5), tabloid, ledger, legal, statement, executive, jisb4, jisb5, widthxheight. By default, txt2pdf will write output in portrait, but this can be changed to landscape by setting this variable to 1 (the default is 0).
With lines, you can set the maximum amount of lines per page (default (pageHeight-72)/vertSpace, pageHeight depends on the paper selected).
With tab, you can set the amount of white space to be used for every tab (default is 8).
With defaultfont you can set the font you want to use to convert the text, with usedfonts you can set the list of fonts you want to use also in background and with the fontmark feature.
The default defaultfont value is F1 (normal Courier). The default value of usedfonts is defaultfont These the 14 PDF default fonts:

  • /F1 normal Courier
  • /F2 italic Courier
  • /F3 bold Courier
  • /F4 bolditalic Courier
  • /F5 normal Helvetica
  • /F6 italic Helvetica
  • /F7 bold Helvetica
  • /F8 bolditalic Helvetica
  • /F9 normal Times
  • /F10 italic Times
  • /F11 bold Times
  • /F12 bolditalic Times
  • /F13 Symbol
  • /F14 ZapfDingbats

these 8 japanese fonts (you have to install Adobe Japanese fonts)):

  • /F20 HeiseiMin-W3-90ms-RKSJ-H
  • /F21 HeiseiMin-W3-90ms-RKSJ-H italic
  • /F22 HeiseiMin-W3-90ms-RKSJ-H bold
  • /F23 HeiseiMin-W3-90ms-RKSJ-H bolditalic
  • /F24 HeiseiKakuGo-W5-90ms-RKSJ-H
  • /F25 HeiseiKakuGo-W5-90ms-RKSJ-H italic
  • /F26 HeiseiKakuGo-W5-90ms-RKSJ-H bold
  • /F27 HeiseiKakuGo-W5-90ms-RKSJ-H bolditalic

4 traditional chinese font (you have to install Adobe traditional Chinese fonts)):

  • /F30 PMingLiU ETen-B5-H
  • /F31 PMingLiU ETen-B5-H italic
  • /F32 PMingLiU ETen-B5-H bold
  • /F33 PMingLiU ETen-B5-H bolditalic
4 simplified chinese font (you have to install Adobe simplified Chinese fonts)):
  • /F35 STSong GB-EUC-H
  • /F36 STSong GB-EUC-H italic
  • /F37 STSong GB-EUC-H bold
  • /F38 STSong GB-EUC-H bolditalic

these 4 korean fonts (you have to install Adobe Korean fonts):

  • /F40 HYSMyeongJoStd KSCms-UHC-H
  • /F41 HYSMyeongJoStd KSCms-UHC-H italic
  • /F42 HYSMyeongJoStd KSCms-UHC-H bold
  • /F43 HYSMyeongJoStd KSCms-UHC-H bolditalic

With pointSize you can set the font point size (default 10).
vertSpace is the distance between two lines (default 12).
With the colour variable you can use a configuration file (e.g. colour.cfg) with a powerful syntax. (see point 3).
With the fontmark variable you can use a configuration file (e.g. fontmark.cfg) with a powerful syntax. (see point 3).
By setting npage to 1 (default is 0) you can add a page number to the end of every page.
By setting border to 1 you can add a border to 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

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 direct 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), TwoPageLeft (this feature wil set PDF version 1.5) that display the pages two at a time, with odd-numbered pages on the left, TwoPageRight (this feature wil set PDF version 1.5) that display the pages two at a time, with odd-numbered pages on the right
With the feature rotate you can rotate 90, 180, 270 degree all the pages of the document. This feature is very important if you need to create a landscape PDF file and want to send it to a fax. The solution is: to create a landscape PDF with rotate : 90
With typeencoding you can select the correct encoding for your OS: WinAnsiEncoding, MacRomanEncoding, MacExpertEncoding, PDFDocEncoding are supported. The default is for Unix
With withextension txt2pdf will create new PDFs appending .pdf to the original name (it won't change the original file extension with .pdf)
sleep : seconds the program will re-run after the configured seconds
pdfdir : directory to set the directory where to put the produced PDFs
e.g. on Windows pdfdir : c:/mypdf/
txtdir : directory to set the directory where to put the initial texts
e.g. on Windows txtdir : c:/mytxt/
NOTE : remember to put / at the end of the directory path
ViewerPreferences : list where there is no list, one or more of these feature: /HideToolbar true /HideMenubar true /HideWindowUI true /FitWindow true /CenterWindow true
/HideToolbar true to hide the viewer application's tool bars when the document is active.
/HideMenubar true to hide the viewer application's menu bar when the document is active.
/HideWindowUI true to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed.
/FitWindow true to resize the document's window to fit the size of the first displayed page.
/CenterWindow true to position the document's window in the center of the screen.
fit : 1 to display the page designated, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically.
zoom : number to set the open of first page with the selected zoom. Default is zoom : 0 (that means don't use this feature) zoom : 1 means 100%. zoom : 1.5 means 150%
list : file inside list file you can put a list of your input textual reports (one every line) using absolute or relative path
Setting pagemark : 1 you can open the PDF inside your browser at the page you prefer to use the URL http://your_site.your_ext/your_pdf_document#pagen where n is the number of the page e.g. http://www.sanface.com/pdf/test.pdf#page2
With inputmod you can set a file where txt2pdf will execute the commands in every line on the input text. Using this feature you can create ad hoc filters. e.g. we have made a wrapper.pl filter to change the number of chars in every line of your textual reports.
In our example the inputmod file is
perl wrapper.pl #!input#
With outputmod you can set a file where txt2pdf will execute the commands with the pdf output. Using this feature you can execute external command on the pdf outputs. e.g. you can move the pdfs in a web directory or send them via email or to a fax or etc.
To put one or more lines before the beginning of the PDF now you can use inside txt2pdf.cfg prepdf.
This feature can be very useful. On Xerox printers + DocuSP controller you can use Xerox Job ticket commands. The "options" must be placed at the beginning of the pdf file, before the %PDF. To print duplex you can use
prepdf: %XRXbegin: 001.0300\n%XRXPDLformat: PDF\n%XRXrequirements: duplex\n%XRXend
(\n means go to a new line)
If you need more information about Xerox Job ticket or how to configure it don't hesitate to contact us.
Pay attention: accordingly with PDF Specification 1.5 (specifically - Implementation Notes 13 and 14) PDF Header in form "%PDF-M.m" or "%!PS-Adobe-N.n PDF-M.m" should appear somewhere within the first 1024 bytes of the file. We suggest you to use this feature only to print the pdf! With annotationtext you can introduce the text you want to put in the annotation on the first page of your document.
If inside a line of your textual report txt2pdf will find the special underline mark (the mark you have specified with underline option) the rest of the line will be write at the begin of the same line.
e.g.
This is a underlined line underline_mark_______________________________
will become
This is a underlined line
In the previously txt2pdf release Internet specific phrases such as http://... ftp://... mailto:...file:... ldap:... news:... and mime: was automatically converted into clickable URL's.
Now we have change policy for 2 reasons:
the conversion is time consuming, Reader 7.x automatically converts www. and @ into links.
If you want to use the old feature you have to set linkuse : 1
We have added ID: (optional, but strongly recommended from PDF 1.1) a file identifier for the file. Although this entry is optional, its absence might prevent the file from functioning in some workflows that depend on files being uniquely identified. If yu don't want to use ID you can use noid : 1
utf8-iso8859-1 : 1 to encode utf8 into iso8859-1
Only with the executable versions you can use set also:
sendmail to set the local sendmail or similar command. The default is sendmail -t -oi -oem
mailhost to set the local or remote smtp host (you can use also the ip address)
notify the email address where you want to receive the notify of the read of your email.
priority to set the email priority. The default 3 means X-Priority: 3 (Normal) and X-MSMail-Priority: Normal. You can use also 1 X-Priority: 1 (Highest) and X-MSMail-Priority: High or 5 X-Priority: 5 (Lowest) and X-MSMail-Priority: Low.
disposition to set the email disposition. The default 0 means inline. To set to attach set to 1.
attachtype to set the email attach type. The default 0 means application/pdf. To set to application/octet-stream set to 1.
mailfrom please change this default nobody@nobody.com with your email
mailsubject the Subject of the email (Your report is the default)
mailbody the body of the email (In attach your report is the default). You can make a multiline body using \n like end of line.
mail_body_file an external file where it's possible to specify the body of the email.
With ftphost, ftpuser, ftppassword, ftpdirectory you can set the ftp site, user, password and the directory where you want to put the final pdf. To convert Czech, Greek, Polish, Hebrew and Thai texts you can:
  • put the text into the correct directory (e.g. a Polish text into polish directory) inside Languages, enter inside the directory (cd) and run txt2pdf
  • copy all the configuration files (e.g. txt2pdf.cfg, language_name.txt, language_name.ttf) in a different directory and use them with your text

If you want different languages or different fonts for the supported languages contact us.

You can also configure colour and fontmark files.  The following is the syntax for the colour.cfg file:
string;number:number:number
where number is > 0 < 1 (the PDF rgb syntax)
String means every string you want to mark with the selected colour
e.g. TOTAL FEDERAL GST ACTIVE;0.5:0:1
You can change sentences with any colour you want.
We use this line to make any internet link blue. Obviously you can change it with your preferred colour
http://[^ \n]*;0:0:1
ftp://[^ \n]*;0:0:1
mailto:[^ \n]*;0:0:1
mime:[^ \n]*;0:0:1
https://[^ \n]*;0:0:1
file:[^ \n]*;0:0:1
ldap:[^ \n]*;0:0:1
news:[^ \n]*;0:0:1
You can use PERL regular expressions, and this is the reason why this is so powerful.
e.g. ^Total federal.*active$;.7;.8;.2

The following is the syntax for the fontmark.cfg file
string;font
where font is one of the 16 fonts.
e.g. TOTAL GRAHAM PIES OLD;/F4
That means: change the default font to the /F4 font in every string "TOTAL GRAHAM PIES OLD"
You may also use PERL regular expressions here.

Pay attention, from txt2pdf version 7.1 we suggest you to put design and text syntax not directly inside bgdesign but inside an EPD. The difference is that using bgdesign txt2pdf will put the line of text and design syntax in every page, with EPD txt2pdf will use import only one time the text and design syntax and links it. This means that with text documents with a lot of pages the final pdf will be smaller.
Inside bgdesign and fgdesign files you can use directly the PDF syntax to draw and to write.  These are a few examples:
If you want to put a bold big diagonal DRAFT on every generated page, you can use the foreground file with:
(REMEMBER to put the text instruction inside BT and ET)

   BT
   /F6 55 Tf
   .5 .5 -.5 .5 150 455 Tm
   (DRAFT) Tj
   ET

/F6 means use italic Helvetica font
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.
Remember you can use inside bgdesign and fgdeisgn the 19 fonts. To use the Japanese fonts remember to set japanese : 1. To use the traditional chinese fonts remember to set tradchinese : 1. To use the simplified chinese fonts remember to set simplchinese : 1. To use the korean fonts remember to set korean : 1.
If you want to draw a black background border line 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 fifth line is: draw.

You can find the information about the PDF syntax you can use in the layers directly in The PDF Reference Manual Version 1.3 second edition PDF (696 pages, ~5 Mb) in the Chapter 4 and 5 (Page Descriptions). Inside bgdesign file you can use EPD vectorial objects
This is the syntax:
#!epd#epdf_file;z1;z2;z3;z4;x_position;y_position#!/epd#
The first field is exact path where txt2pdf can find the EPD file (you can use also relative path)
2nd, 3rd, 4th and 5th fields are very powerful and complex. You can use it to scale or even rotate the EPD.
At the beginning, we suggest you use:
z1=1, z2=0, z3=0, z4=1
to scale correctly n EPD to divide or multiply z1 and z4 for the same integer
You can find the information about the PDF transformation syntax in The PDF Reference Manual Version 1.3 second edition PDF (696 pages, ~5 Mb) in the Chapter 4.2.
6th and 7th fields are the x and y position on the page (0,0 the bottom left corner)
This is an example
#!epd#../EPD/john.epd;1;0;0;1;50;400#!/epd#

You can test your new files easily changing into the Tests directory and running the following command:
../txt2pdf(.pl) -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
The - (minus char, like Unix style, means: read from standard input, write to standard output)

Syntax

Pay attention: you can use -mailto, -mailcc and -mailbcc only with the Windows executable versions
txt2pdf [-options] files or http urls
where options include:

-help
-configure file
-landscape
-list file
-paper format
-npage
-recursive directory
-match files
-border
-pdfdir directory
-txtdir directory
-mailto "name@domain.com"
-mailcc "name@domain.com"
-mailbcc "name@domain.com"
-current
-verbose
-test
-
print out this message
default txt2pdf.cfg

a list of textual input files
default letter, valid formats: A3 (or a3), A4 (or a4), A5 (or a5), widthxheight
add page number
scan recursively the directory
match different files ex. *.pdf, a?.* (require -recursive option)
border line
the directory where you want to put the PDF's
the directory where you want to put the text
to send the generated PDFs to the specify email addresses
to send the generated PDFs cc to the specify email addresses
to send the generated PDFs bcc to the specify email addresses
the program version
verbose
run a test without conversions
use STDIN and STDOUT

list:
with list you can use metacharacters and relative and absolute path names.

  • -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 an automatic task (e.g. cron).
    e.g.
    txt2pdf -c c.cfg *.c
    txt2pdf -c perl.cfg *.pl *.pm
    txt2pdf -c url.cfg http://www.sanface.com/.../test.txt
  • -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 .
    will convert every file beginning with a and with txt extension to PDF inside the . directory and in every its subdirectories
  • Every file in the list is converted into 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.

Other Features

  • CreationDate - The date the document was created is automatically set in the Info dictionary.
  • Automatic conversion of words like http://..., ftp://..., mailto:..., file:... etc to URL's.
  • Automatic conversion if mime:... links to launch the correct application to open a file (Windows)
  • POD Documentation inside.

Multiuser Features

txt2pdf is powerful enough for System Administrators to install globally and provide a default .cfg file for their users/organization.  This can be easily done by:

  • setenv TXT2PDFCFG /path/to/default.cfg (This can be added to .bashrc, .cshrc etc  for example)
  • define/system TXT2PDFCFG pathto:default.cfg (VMS in SYLOGIN.COM for example)

An user can still overwrite the default values by using another setenv or by defining in his own login files if he has a default .cfg file of his/her own.  An user can still have a working directory with a txt2pdf.cfg and, if it exists, have it loaded.  That allows him/her (without command line options) to setup fully functional working directories.  Users may also use the -configure option to overwrite any defaults.

Euro Compliance

From The PDF Reference Manual Version 1.3 second edition "Note that in the WinAnsiEncoding, character code 128 is used for Euro."  Remember you need a PDF 1.3 Reader (e.g. Acrobat Reader 4.xx) for this functionality.  See the example you can find also in the Tests directory in every distribution.

What's new in this version?

  • minor bug fixed

Click here for an exhaustive history file.