Coder Social home page Coder Social logo

pdftools's Introduction

PDFtools

A set of scripts which make handling PDFs easier. Works across all platforms. Tested on Pop! OS 20.04 and Python 3.8.11.

merger

Script to merge PDFs

Usage

Open Terminal where the script is present

 $ python pdfmerger.py 
Enter the path to the pdf files : /media/greed/Windows8_OS/Me/Files/VIT/FALLSEM_17-18/OS
Enter output filename : osfatportions
Wait...
Done xD
 $ 

subset

Script to create a PDF which is a subset of the original PDF.

Usage

Open Terminal where the script is present, make sure the script and the pdf file are in the same directory.

Note : when you give 6-13, it includes 6, 13 and all the numbers inbetween them.

 $ python subset.py
Enter the name of the pdf : osfatportions
Enter the slicing : 1-3 6-13 16 19-20
Enter output filename : splitted
Wait...
Processing 498 pages...
Returning 14 pages...
Done.
 $ 

images2pdf

Script to create a PDF with all the images in the current working directory.

Usage

Open Terminal where the script and the images are present and run the images2pdfgenereator.py

Note: script supports both .jpg and .png formats only. Haven't tested with any other formats.

λ python images2pdfgenerator.py
Enter output filename: test
Done.
λ

pdftools's People

Contributors

greed2411 avatar minosai avatar

Stargazers

 avatar  avatar  avatar  avatar

pdftools's Issues

Getting deprecation warning with PyPDF2

Getting this error with main, Altough I got it working with commit 423abf0ab2c5a4f03b70687329f4b4e1df211011

This is unrelated to the problem, but I'd recommend using a .gitignore template as well.

(venv) C:\PDFtools>python subset.py
Enter the name of the pdf : input
Enter the slicing : 28-38
Traceback (most recent call last):
  File "C:\PDFtools\subset.py", line 68, in <module>
    main()
  File "C:\PDFtools\subset.py", line 64, in main
    pdf_name, pdfFileObj, pages, pdfReader, num_of_pages, output = gather_info()
                                                                   ^^^^^^^^^^^^^
  File "C:\PDFtools\subset.py", line 55, in gather_info
    pdfReader = PdfFileReader(pdfFileObj)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\PDFtools\venv\Lib\site-packages\PyPDF2\_reader.py", line 1974, in __init__
    deprecation_with_replacement("PdfFileReader", "PdfReader", "3.0.0")
  File "C:\PDFtools\venv\Lib\site-packages\PyPDF2\_utils.py", line 369, in deprecation_with_replacement
    deprecation(DEPR_MSG_HAPPENED.format(old_name, removed_in, new_name))
  File "C:\PDFtools\venv\Lib\site-packages\PyPDF2\_utils.py", line 351, in deprecation
    raise DeprecationError(msg)
PyPDF2.errors.DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.

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.