A Python-based tool converting a text file to a PDF file
Project description
Text File to PDF
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3a5c820b2ec5f99563423c362ce26019871595eb3424f2442369544e5f883f1
|
|
| MD5 |
008934de9fe94f7dc85048c2a13bbf6e
|
|
| BLAKE2b-256 |
2b2746509bf50ed4d584e721e11a051e449dd241705708b32a225d5165e09ba4
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
text_file_to_pdf-0.0.11.tar.gz -
Subject digest:
f3a5c820b2ec5f99563423c362ce26019871595eb3424f2442369544e5f883f1 - Sigstore transparency entry: 236523402
- Sigstore integration time:
-
Permalink:
TruckCab/text-file-to-pdf@e65a501c4c667d6123a82eba804c26b7dd740e22 -
Branch / Tag:
refs/tags/0.0.11 - Owner: https://github.com/TruckCab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@e65a501c4c667d6123a82eba804c26b7dd740e22 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file text_file_to_pdf-0.0.11-py3-none-any.whl.
File metadata
- Download URL: text_file_to_pdf-0.0.11-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ce77fce965af20728727e8fe245b74181f00bcb0de981c9192a469f7020604
|
|
| MD5 |
7d9234679febd14813baeabd55b8e132
|
|
| BLAKE2b-256 |
478c646580afe93862d8d5dfd8683b79b925a2173dbf5f6a34a60ea0b9710725
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
text_file_to_pdf-0.0.11-py3-none-any.whl -
Subject digest:
53ce77fce965af20728727e8fe245b74181f00bcb0de981c9192a469f7020604 - Sigstore transparency entry: 236523408
- Sigstore integration time:
-
Permalink:
TruckCab/text-file-to-pdf@e65a501c4c667d6123a82eba804c26b7dd740e22 -
Branch / Tag:
refs/tags/0.0.11 - Owner: https://github.com/TruckCab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@e65a501c4c667d6123a82eba804c26b7dd740e22 -
Trigger Event:
workflow_dispatch
-
Statement type: