Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

📄 App3 - PDF Template Generator

Python License Status

📋 About

App3 - PDF Template Generator is a Python-based application that automates the creation of professional PDF documents using customizable templates. The application streamlines the process of generating multiple PDF files from structured data, making it ideal for creating certificates, invoices, reports, or any other templated documents at scale.

This tool leverages the power of Python libraries to transform simple CSV data into polished, formatted PDF documents, saving time and ensuring consistency across all generated files.


✨ Features

  • 🎨 Template-Based Generation: Use customizable PDF templates for consistent document styling
  • 📊 CSV Data Integration: Import data from CSV files to populate PDF fields automatically
  • Batch Processing: Generate multiple PDFs in one execution
  • 🖼️ Image Support: Include logos, signatures, and other images in your documents
  • 📐 Precise Positioning: Control exact placement of text and images on the page
  • 💼 Professional Output: Create polished, print-ready PDF documents
  • 🔄 Reusable Templates: Design once, generate unlimited documents
  • 🚀 Easy to Use: Simple command-line interface

🛠️ Technologies Used

  • Python 3.x: Core programming language
  • FPDF: PDF document generation library
  • Pandas: Data manipulation and CSV processing
  • PIL (Pillow): Image processing capabilities

📁 Project Structure

App3-Pdf-template/
│
├── main.py                 # Main application script
├── topics.csv             # Sample data file with content to populate
├── pdf_template.pdf       # Base PDF template
├── font/                  # Custom fonts directory
│   └── *.ttf             # TrueType font files
└── files/                # Output directory for generated PDFs
    └── *.pdf             # Generated PDF documents

🚀 Getting Started

Prerequisites

Ensure you have Python 3.x installed on your system. You can download it from python.org.

Installation

  1. Clone the repository

    git clone https://github.com/Sachethanv/App3-Pdf-template.git
    cd App3-Pdf-template
  2. Install required dependencies

    pip install fpdf pandas pillow

    Or if you have a requirements file:

    pip install -r requirements.txt
  3. Prepare your data

    • Edit topics.csv with your custom data
    • Ensure your CSV columns match the template fields

Running the Application

python main.py

Generated PDF files will be saved in the files/ directory.


💡 Usage Example

  1. Prepare your CSV file (topics.csv):

    Name,Title,Date
    John Doe,Python Developer,2025-01-15
    Jane Smith,Data Scientist,2025-01-16
  2. Run the generator:

    python main.py
  3. Find your PDFs in the files/ folder with professional formatting applied!


🎯 Use Cases

  • 📜 Certificates: Generate completion certificates for courses or events
  • 🧾 Invoices: Create batch invoices for multiple clients
  • 📊 Reports: Produce standardized reports with variable data
  • 💌 Letters: Generate personalized letters or documents
  • 🎫 Tickets: Create event tickets or passes
  • 📋 Forms: Populate and generate form documents

⚙️ Configuration

Customizing Templates

Modify the template parameters in main.py:

# Example configuration
font_size = 12
text_color = (0, 0, 0)  # RGB values
position_x = 100
position_y = 50

Adding Custom Fonts

Place your .ttf font files in the font/ directory and reference them in your script:

pdf.add_font('CustomFont', '', 'font/YourFont.ttf', uni=True)
pdf.set_font('CustomFont', size=14)

📦 Dependencies

Create a requirements.txt file with:

fpdf>=1.7.2
pandas>=1.3.0
Pillow>=8.0.0

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add comments for complex logic
  • Test your changes thoroughly
  • Update documentation as needed

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


👤 Author

Sachethan V


🌟 Acknowledgments

  • Thanks to the FPDF library developers for making PDF generation accessible
  • Inspired by the need for efficient document automation
  • Built with ❤️ for developers who value automation

📞 Support

If you encounter any issues or have questions:

  • Open an Issue
  • Check existing issues for solutions
  • Contribute improvements via Pull Requests

🔮 Future Enhancements

  • GUI interface for easier template design
  • Support for additional PDF libraries
  • Advanced formatting options (tables, charts)
  • Multiple template support
  • Excel file input support
  • PDF merging capabilities
  • Email integration for automated sending

Made with 💙 by Sachethan V

⭐ Star this repository if you find it helpful!

About

A Python-based PDF template generator that automates the creation of professional PDF documents from CSV data. Perfect for certificates, invoices, reports, and more.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages