Sign inSign up

jacklugano/affranca_app

By jacklugano

•Updated about 2 years ago

Image
0

395

jacklugano/affranca_app repository overview

⁠Readme for script that adds address to PDF and overlays with affrancatura PDF

This script is a web application that allows users to upload a PDF file and add an address to it. The script then overlays the PDF with an affrancatura PDF and returns the resulting PDF with the address added.

⁠Requirements

This script requires Python 3 and the following Python packages:

  • os
  • shutil
  • PyPDF2
  • flask
  • werkzeug
  • reportlab

The script also requires two directories to exist: /app/volume1/uploads for uploaded files and /app/volume1/affrancatura for affrancatura PDFs.

⁠Installation

To install the required packages, run:

pip install -r requirements.txt

where requirements.txt is a file containing the names of the required packages.

⁠Usage

To use this script:

  1. Ensure that the /app/volume1/uploads and /app/volume1/affrancatura directories exist.
  2. Set the ADDRESS_POSITION_X and ADDRESS_POSITION_Y environment variables to the coordinates of the address on the page.
  3. Add one or more affrancatura PDF files to the /app/volume1/affrancatura directory.
  4. Run the script using the command:
python add_address_and_overlay.py
  1. Navigate to http://localhost:5000 in a web browser to use the web application.
  2. Upload a PDF file and enter an address.
  3. Click the "Stampa" button to download the resulting PDF with the address added and the affrancatura overlayed.
⁠Logging

The script does not log any activity.

⁠License

This script is licensed under the MIT License⁠.

Tag summary

Content type

Image

Digest

sha256:74d5d8fa2…

Size

322.7 MB

Last updated

about 2 years ago

docker pull jacklugano/affranca_app