whyboris/PDF-to-JPG-to-PDF

Convert PDF to JPG images, convert JPG images to PDF, extract select pages from a PDF into a new PDF

1

stars

8

commits

JavaScript

primary language

Nov 10, 2024

updated

README

PDF to JPG to PDF

  1. a script to convert PDF to JPG files
  2. a script to convert JPG files to PDF
  3. a script to create a PDF using only some pages from another PDF

Do you have a PDF form you need to fill out? Perhaps it's Form I-864 but the assholes who created the form didn't make all the fields editable, so there is no way to complete it on the computer? But you live in 2023 and priting it out, only to fill it out by hand, and then to have to scan it in to submit it is insane, so you spend a few hours writing code to make it work?

Just use these scripts to convert your PDF into JPG, edit it in Photoshop or some software, and then convert the JPG files into a PDF.

How to use

If you're new to coding follow the directions below:

Please read: Terminal is a tool you use to make your computer execute commands (anything formatted this way below is a command you run in your terminal). There are many terminals to choose from:

  • Mac: you can use the default terminal that comes with the OS
  • Windows: you can use Git Bash which is installed when you install git or use Powershell that is part of the OS
  1. install git
  2. install node (works with v18 but not v20)
  3. clone this repository by running git clone https://github.com/whyboris/PDF-to-JPG-to-PDF
  4. enter the folder: cd PDF-to-JPG-to-PDF
  5. run npm install

Now you're ready for the last steps:

TL;DR

  1. Put your PDF in this folder
  2. rename it to input.pdf (or update the first line of pdf2jpg.js to the name of your PDF)
  3. run npm run tojpg and you have JPG images in the /jpg folder

After editing your images in the /jpg folder, run npm run topdf and you'll have a PDF generated from your images.

To generate a PDF with only selected pages from another PDF, update split.js file and run npm run extract.

Contributors

whyboris

8 commits

whyboris/PDF-to-JPG-to-PDF

Convert PDF to JPG images, convert JPG images to PDF, extract select pages from a PDF into a new PDF

1

stars

8

commits

JavaScript

primary language

Nov 10, 2024

updated

README

PDF to JPG to PDF

  1. a script to convert PDF to JPG files
  2. a script to convert JPG files to PDF
  3. a script to create a PDF using only some pages from another PDF

Do you have a PDF form you need to fill out? Perhaps it's Form I-864 but the assholes who created the form didn't make all the fields editable, so there is no way to complete it on the computer? But you live in 2023 and priting it out, only to fill it out by hand, and then to have to scan it in to submit it is insane, so you spend a few hours writing code to make it work?

Just use these scripts to convert your PDF into JPG, edit it in Photoshop or some software, and then convert the JPG files into a PDF.

How to use

If you're new to coding follow the directions below:

Please read: Terminal is a tool you use to make your computer execute commands (anything formatted this way below is a command you run in your terminal). There are many terminals to choose from:

  • Mac: you can use the default terminal that comes with the OS
  • Windows: you can use Git Bash which is installed when you install git or use Powershell that is part of the OS
  1. install git
  2. install node (works with v18 but not v20)
  3. clone this repository by running git clone https://github.com/whyboris/PDF-to-JPG-to-PDF
  4. enter the folder: cd PDF-to-JPG-to-PDF
  5. run npm install

Now you're ready for the last steps:

TL;DR

  1. Put your PDF in this folder
  2. rename it to input.pdf (or update the first line of pdf2jpg.js to the name of your PDF)
  3. run npm run tojpg and you have JPG images in the /jpg folder

After editing your images in the /jpg folder, run npm run topdf and you'll have a PDF generated from your images.

To generate a PDF with only selected pages from another PDF, update split.js file and run npm run extract.

Contributors

whyboris

8 commits

Languages

JavaScript

100.0%