GithubHelp home page GithubHelp logo

rotate-pdf's Introduction

Rotate PDF

This Python script uses the PyPDF2 module to rotate each page of a PDF file by a specified number of degrees.

It simplifies the process of rotating the pages of a PDF file, allowing the user to easily and quickly rotate multiple pages without having to manually open the PDF and rotate each page individually. It is particularly useful for PDF files with a large number of pages, as the program can rotate all of the pages in just a few seconds.

How it works

The script first imports the PyPDF2 module, which is used to manipulate PDF files in Python. It then opens the input PDF file, reads its pages, and rotates each page by the specified number of degrees. The rotated pages are then written to a new PDF file.

How to use

  1. Install the PyPDF2 module by running the following command:

pip install PyPDF2

  1. Open the rotate_pdf.py file in a text editor and specify the input and output file names, as well as the rotation angle, at the top of the file:
# The input and output file names
INPUT_FILE = "input.pdf"
OUTPUT_FILE = "output.pdf"

# The rotation angle (in degrees)
ANGLE = 90
  1. Run the script by running the following command:

python rotate_pdf.py

The rotated PDF will be written to the output file specified in the script.

Note that you may need to adjust the code to match your specific requirements.

rotate-pdf's People

Contributors

apullo777 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.