Skip to content

Created a python app that combines keyword-specific images to PDF document.

Notifications You must be signed in to change notification settings

dheerajkallakuri/ImgstoPdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImgstoPdf App: Converting a set of specific keyword Images to pdf

ImgstoPdf is a Python application that provides a simple graphical interface for searching and downloading images from an open-source photo database using an API. After fetching the images based on a user-defined keyword, the application converts the images into a single PDF file. The GUI also includes a loading bar to display the progress of the image download.

Screenshot 2024-09-06 at 9 35 05 PM

Project Overview

This repository contains the following components:

  1. app.py: The main graphical user interface (GUI) of the application, created using PyQt5. Users can input the number of images and the keyword for which they want to fetch photos. Upon clicking "Export to PDF," an API call is made to Unsplash to download the specified number of images. Once the images are successfully downloaded, they are converted into a PDF. The GUI also features a loading bar that updates based on the progress of the image download.
Screenshot 2024-09-06 at 9 35 19 PM
  1. image_fetcher.py: This Python script handles API calls to Unsplash to fetch images based on the provided keyword. It saves the downloaded images into a specified folder.

  2. pdf_converter.py: This script takes the images from the specified folder stores them in an array data structure and combines them into a single PDF file.

  3. image_checker.py: This utility script checks the types of images downloaded via API calls. It is useful for debugging and verifying the content of the downloaded images.

Results

Screenshot 2024-09-06 at 9 35 32 PM Screenshot 2024-09-06 at 9 36 11 PM

Getting Started

Prerequisites

Make sure you have Python installed. You can install all required libraries using the requirements.txt file provided in the repository.

Installation

  1. Clone the repository:

    git clone https://github.com/dheerajkallakuri/ImgstoPdf.git
  2. Navigate to the project directory:

    cd ImgstoPdf
  3. Install the required libraries:

    pip install -r requirements.txt

Running the Application

To run the application, execute the app.py file:

python app.py

How It Works

  1. GUI Interaction:

    • Open app.py to launch the GUI.
    • Enter the number of images and the keyword for the image search.
    • Click "Export to PDF" to initiate the process.
  2. Image Fetching:

    • app.py calls image_fetcher.py to download images from Unsplash based on the provided keyword.
    • Images are saved in a folder named with the current timestamp.
  3. PDF Conversion:

    • After images are downloaded, app.py calls pdf_converter.py to convert these images into a PDF file.
  4. Progress Tracking:

    • The loading bar in the GUI updates as images are downloaded.
  5. Debugging:

    • Use image_checker.py to verify the types of images downloaded and ensure they meet your requirements.

File Details

  • app.py: Main application GUI.
  • image_fetcher.py: Handles API calls and image saving.
  • pdf_converter.py: Converts images to PDF.
  • image_checker.py: Checks and debugs image types.

About

Created a python app that combines keyword-specific images to PDF document.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages