Skip to main content

A Python-based tool converting a text file to a PDF file

Project description

Text File to PDF

text-file-to-pdf-ci Supported Python Versions PyPI version PyPI Downloads

The text-file-to-pdf is a command-line utility that allows you to convert text files into PDF format. It supports various configurations such as page orientation, units, font type, font size, and margins.

Install package

You can install text-file-to-pdf from source.

Option 1 - from PyPi

# Create the virtual environment
python3 -m venv .venv

# Activate the virtual environment
. .venv/bin/activate

pip install text-file-to-pdf

Option 2 - from source - for development

git clone https://github.com/TruckCab/text-file-to-pdf.git

cd text-file-to-pdf

# Create the virtual environment
python3 -m venv .venv

# Activate the virtual environment
. .venv/bin/activate

# Upgrade pip, setuptools, and wheel
pip install --upgrade pip setuptools wheel

# Install text-file-to-pdf - in editable mode with dev dependencies
pip install --editable .[dev]

Note

For the following commands - if you running from source and using --editable mode (for development purposes) - you will need to set the PYTHONPATH environment variable as follows:

export PYTHONPATH=$(pwd)/src

Usage

Help

text-file-to-pdf --help
Usage: text-file-to-pdf [OPTIONS]

Options:
  --version / --no-version        Prints the "Text File to PDF" program
                                  version and exits.  [required]
  --input-file TEXT               The input text file to convert to PDF
                                  format.  The path can be relative or
                                  absolute.  [required]
  --output-file TEXT              The output PDF file to create.  The path can
                                  be relative or absolute.  [required]
  --orientation [portrait|landscape]
                                  The page orientation to use for the PDF
                                  file.  [required]
  --unit [pt|mm|cm|in]            The units to use for the PDF.  [default: mm;
                                  required]
  --format [a3|a4|a5|letter|legal]
                                  The page (paper) format for the PDF file.
                                  [default: letter; required]
  --font-name [courier|helvetica|times]
                                  The font to use in the PDF file.  [default:
                                  courier; required]
  --font-size INTEGER             The font-size to use in the PDF file.
                                  [default: 9; required]
  --left-margin FLOAT             The left margin for the PDF - in cm.
                                  [default: 5.669291338582678; required]
  --top-margin FLOAT              The top margin for the PDF - in cm.
                                  [default: 9.921259842519683; required]
  --help                          Show this message and exit.

Handy development commands

Version management

Bump the version of the application - (you must have installed from source with the [dev] extras)
bumpver update --patch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

text_file_to_pdf-0.0.11.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

text_file_to_pdf-0.0.11-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file text_file_to_pdf-0.0.11.tar.gz.

File metadata

  • Download URL: text_file_to_pdf-0.0.11.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for text_file_to_pdf-0.0.11.tar.gz
Algorithm Hash digest
SHA256 f3a5c820b2ec5f99563423c362ce26019871595eb3424f2442369544e5f883f1
MD5 008934de9fe94f7dc85048c2a13bbf6e
BLAKE2b-256 2b2746509bf50ed4d584e721e11a051e449dd241705708b32a225d5165e09ba4

See more details on using hashes here.

Provenance

The following attestation bundles were made for text_file_to_pdf-0.0.11.tar.gz:

Publisher: ci.yml on TruckCab/text-file-to-pdf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file text_file_to_pdf-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for text_file_to_pdf-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 53ce77fce965af20728727e8fe245b74181f00bcb0de981c9192a469f7020604
MD5 7d9234679febd14813baeabd55b8e132
BLAKE2b-256 478c646580afe93862d8d5dfd8683b79b925a2173dbf5f6a34a60ea0b9710725

See more details on using hashes here.

Provenance

The following attestation bundles were made for text_file_to_pdf-0.0.11-py3-none-any.whl:

Publisher: ci.yml on TruckCab/text-file-to-pdf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page