Skip to main content

Utility for arranging short text in the PDF with minimum amount of empty space between text.

Project description

Norijada PDF

Norijada PDF is a Python library for generating PDF files from text files containing short text.

Installation

Create virtual environment and install norijada-pdf

pip install norijada-pdf

Usage

  1. List available fonts
norijada-pdf list-fonts
  1. Add new fonts
norijada-pdf add-fonts

Specify directory name other than fonts

norijada-pdf add-fonts --dir some_dir
  1. Generate PDF

Settings will be automatically created in the current directory if it does not exist under settings.json file.

Example settings.json file

{
    "font_sizes": {
        "Bangers-Regular": 195,
        "BebasNeue-Regular": 195,
        "BerkshireSwash-Regular": 158,
        "BlackOpsOne-Regular": 139,
        "Bungee-Regular": 120,
        "Courgette-Regular": 156,
        "Galindo-Regular": 140,
        "KaushanScript-Regular": 167,
        "LibreBaskerville-Regular": 140,
        "Lobster-Regular": 172,
        "MouseMemoirs-Regular": 223,
        "Pacifico-Regular": 147,
        "PatrickHand-Regular": 190,
        "Ranchers-Regular": 170,
        "RubikMonoOne-Regular": 100,
        "RussoOne-Regular": 140,
        "SigmarOne-Regular": 110,
        "Staatliches-Regular": 180,
        "TitanOne-Regular": 130
    },
    "plot_increment": 1,
    "page_width": 500,
    "default_font_size": 150,
    "max_length": 240
}

You can modify existing settings.json file or reset to defaults by running

norijada-pdf reset-settings

PDF generator requires an input.txt file in the current directory. Input file should contain nicknames separated by new line. Additional arguments can be passed to the generator. Run help command to see all available arguments

norijada-pdf generate-pdf --help

Run the PDF generator with the following command

norijada-pdf generate-pdf --font BebasNeue-Regular.ttf

Add unique id to the end of the file name

norijada-pdf generate-pdf --font BebasNeue-Regular.ttf --file-id prhg-8a

Example input.txt file

Netko Je Super Lik
Čižo
Štupid
Čakra
jajoslav
Kico
Poki
Šokac
Šabo
jajan
Košček
Čupavac
Vau
Kora
Đuro
Pero
Stavros
Jasmin Stavros
Jasmin
Kalodont

Example output pdf file nicknames-prhg-8a.pdf

Example output pdf file rotated nicknames-prhg-8a-rotated.pdf

License

MIT

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

norijada_pdf-0.0.6.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

norijada_pdf-0.0.6-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file norijada_pdf-0.0.6.tar.gz.

File metadata

  • Download URL: norijada_pdf-0.0.6.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.9 Windows/10

File hashes

Hashes for norijada_pdf-0.0.6.tar.gz
Algorithm Hash digest
SHA256 fe9dae697aadd2d3ec5f1db5a9249c28923e958257895f2af78899efa2c9a0b3
MD5 21631b8e8cd1c096fc5f9311e43eee8d
BLAKE2b-256 9a4d763c87abe33a075b05c62751bad115da77578afc5328aa673a17e9b245bf

See more details on using hashes here.

File details

Details for the file norijada_pdf-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: norijada_pdf-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.9 Windows/10

File hashes

Hashes for norijada_pdf-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d39394250d4f384644b1f5802c7ef1a375bb6ff0eccc992c0b5f3166442bdf74
MD5 0bf6ce2cbb8cdf67ae94eb519089f6a1
BLAKE2b-256 1091519cc94db83b652ae47e52b88c877d9db32af84db8881591923dfeaec331

See more details on using hashes here.

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