Coder Social home page Coder Social logo

ptxt's Introduction

ptxt: Fast Text-to-PDF Converter

The ptxt utility is a text-to-PDF converter aiming to:

  • be blazing fast ๐Ÿš€
  • be light weight ๐Ÿชถ
  • have a low memory footprint ๐Ÿ’ช
  • support interactive conversion ๐Ÿ“œ

To reach these goals, ptxt uses an ad-hoc solution instead of depending on a full-feature PDF library or rendering engine.

News about this project will be published at Twitter.

Output Style

By default, the program produces a document as if written on a typewriter.

The following options are configurable:

Option Short Long Default
Number of columns -c --columns 80
Number of rows -r --rows 60
Tab stop -t --tab-stop 8
Left margin -x --offx 1in (72pt)
Top margin -t --offy 1in (72pt)
Font size -s --font-size 10pt
Font style -f --font mono

Limitations

Some features are desired, but are not implemented yet:

  • Allow font embedding.
  • Right and bottom margins (requires font library.)
  • Automatic column and row detection (requires font library.)

Examples

  • ptxt file

    Convert file to PDF using default options. The result is printed to stdout. If file is omitted, stdin is used. The special - also specifies stdin but with block buffering instead (useful if you're piping large amounts of data.)

  • nl -b a ptxt.c | ptxt - -s 8 -c 72 -r 55 -f mono -t 4 -x 1.5in -y 1.5in -o ptxt.pdf

    Number all lines in ptxt.c and convert to PDF using block buffered stdin, 8pt font, 72 columns, 55 rows, standard monospaced font (Courier), 4-space tab stop, 1.5 inch left and top margins, outputting to ptxt.pdf.

  • ptxt --help

    Print the usage.

  • ptxt --version

    Print version information.

See ptxt(1) for more information.

Installation

$ make NDEBUG=1
$ sudo make install

To uninstall,

$ sudo make uninstall

ptxt's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.