Coder Social home page Coder Social logo

pdfwizard's Introduction

PDFWizard - PDF Editing Toolkit

Description

This repository contains Python scripts for editing PDF files, particularly focusing on tasks like removing specific marks and resizing pages with bleeding. These scripts can be handy for individuals or businesses needing to manipulate PDF documents programmatically.

Contents

  1. pdfwizard: This directory contains scripts for modifying the content of PDF files.
    • mirrorer.py: PDFMirrorer allows mirroring a PDF on vertical, horizontal, or both axes using PyPDF.
    • redactor.py: PDFRedactor removes specific marks from PDF documents using PyMuPDF (fitz).
    • scaler.py: PDFScaler modifies the page size of every page of the PDF using PyMuPDF (fitz).
    • bleeder.py: PDFBleeder adds the bleed margin to the PDF.
    • __main__.py: This script serves as a program that exposes the functionalities provided by the pdfwizard scripts for editing PDF files. It demonstrates how to utilize these functionalities effectively.

Installation

git clone [email protected]:paolpal/PDFWizard.git
cd PDFWizard
pip install .

Uninstall

To uninstall PDFWizard, run:

pip uninstall pdfwizard

Usage

To use the PDF transformation tool, run pdfwizard with the following command-line arguments:

pdfwizard -i input.pdf -o output.pdf -n "string_to_remove" -s Letter -b 9 --no-bleed

Command-line arguments:

  • -i, --input: Specify the input PDF file.
  • -o, --output: Specify the output PDF file (default: out.pdf if not specified).
  • -n, --needle: Optional. Specify a string to remove from the PDF pages.
  • -s, --size: Optional. Specify the page size for resizing the PDF (Letter, Legal, etc.).
  • -b, --bleed: Optional. Specify the bleed value for PDF pages (default: 0).
  • --no-bleed: Optional flag. Disable bleeding for PDF pages.

Examples

  1. Resize a PDF to A4 size:
pdfwizard -i input.pdf -s A4
  1. Remove a watermark from a PDF:
pdfwizard -i input.pdf -n "Confidential"
  1. Apply bleeding and resize a PDF:
pdfwizard -i input.pdf -s A4 -b 5

Notes:

At least one of -n, -s, or -b must be provided for the tool to perform any action. If -o is not specified, the output PDF will default to out.pdf. Ensure all paths to PDF files are correctly specified.

Dependencies

  • PyMuPDF
  • PyPDF
  • tqdm

Disclaimer

These scripts are intended for automated or batch processing of PDF files. Ensure that you have the necessary permissions to modify the PDF files and that you understand the implications of the transformations being applied. Always make backups of important files before performing any modifications.

pdfwizard's People

Contributors

dependabot[bot] avatar paolpal avatar

Stargazers

 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.