GithubHelp home page GithubHelp logo

cbz_to_pdf's Introduction

CBZ to PDF Converter

This program converts CBZ (Comic Book Archive) files into PDF files. It uses Ghostscript to optimize the resulting PDF file size.

Description

cbz_to_pdf Converter is script tool that simplifies the process of converting comic book archives (CBZ files) into easily shareable and readable PDF files. Ghostscript is used to ensure the PDF files are optimized for size without compromising quality.

Prerequisites

  • Python 3.x
  • Ghostscript

Installation

pip install -r requirements.txt

Ghostscript Installation

Windows

  1. Download Ghostscript:

  2. Install Ghostscript:

    • Run the downloaded installer and follow the installation instructions.
  3. Add Ghostscript to the System PATH:

    • Open the Start Menu, search for "Environment Variables", and select "Edit the system environment variables".
    • In the System Properties window, click the "Environment Variables..." button.
    • In the Environment Variables window, find the "Path" variable in the "System variables" section and select it, then click "Edit...".
    • Click "New" and add the path to the Ghostscript bin directory (e.g., C:\Program Files\gs\gs10.03.0\bin).
    • Click "OK" to close all dialog boxes.
  4. Verify the Installation:

    • Open a Command Prompt and type gswin64c -v (or gswin32c -v for the 32-bit version).
    • You should see output displaying the Ghostscript version.
  5. Create an Alias in PowerShell:

    • Open a Command Prompt and type gswin64c -v (or gswin32c -v for the 32-bit version).
    • You should see output displaying the Ghostscript version.

Based on the output you provided, it seems that the Ghostscript path (C:\Program Files\gs\gs10.03.0\bin) is included in your PowerShell PATH. However, the gs command is still not recognized. Here are a few more steps to resolve this issue:

Create an Alias in PowerShell

  1. Navigate to the Ghostscript bin directory:

    cd "C:\Program Files\gs\gs10.03.0\bin"
  2. List the files to confirm the executable name:

    Get-ChildItem

1. Create an Alias in PowerShell. If the executable is not gs.exe, create an alias for convenience.

2. If the executable is gswin64c.exe, create an alias in PowerShell:

Set-Alias -Name gs -Value "C:\Program Files\gs\gs10.03.0\bin\gswin64c.exe"

3. Test the alias:

gs -v

4. Add the Alias to Profile for Persistence: To make the alias persistent across PowerShell sessions, add it to your PowerShell profile.

  1. Open the PowerShell profile script:

    if (!(Test-Path -Path $PROFILE)) {
        New-Item -ItemType File -Path $PROFILE -Force
    }
    notepad $PROFILE
  2. Add the alias command to the profile:

    Set-Alias -Name gs -Value "C:\Program Files\gs\gs10.03.0\bin\gswin64c.exe"
  3. Save and close the file.

  4. Restart PowerShell and test the gs command:

    gs -v

** 5. Verify Execution Policy** Ensure the execution policy allows for the script in the profile to run:

  1. Check the current execution policy:

    Get-ExecutionPolicy
  2. Set the execution policy to RemoteSigned if necessary:

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

macOS

  1. Install Homebrew (if not already installed):

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Update Homebrew:

    brew update
  3. Install Ghostscript:

    brew install ghostscript
  4. Verify the Installation:

    gs --version

Linux

Ubuntu/Debian
  1. Update the package list:

    sudo apt update
  2. Install Ghostscript:

    sudo apt install ghostscript
  3. Verify the Installation:

    gs --version
Fedora
  1. Update the package list:

    sudo dnf check-update
  2. Install Ghostscript:

    sudo dnf install ghostscript
  3. Verify the Installation:

    gs --version
Arch Linux
  1. Update the package list (if necessary):

    sudo pacman -Syu
  2. Install Ghostscript:

    sudo pacman -S ghostscript
  3. Verify the Installation:

    gs --version

Example

python main.py 
Menu
1. Add the cbz file
2. Add the cbz file and the output directory
3. reduce pdf size
4. cbz to pdf and reduce its size
5. Exit
Enter your choice: 

cbz_to_pdf's People

Contributors

magnusterra avatar

Stargazers

Adam Hill avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.