I find this tiny little utility for creating PDFs from JPGs Useful

What other productivity software are you working with...
Post Reply
Dustydog
Posts: 315
Joined: 13 Jun 2016 04:19

I find this tiny little utility for creating PDFs from JPGs Useful

Post by Dustydog » 17 May 2020 11:24

Here's some commented, exceedingly simple, code with links in comments. This program is extraordinarily fast. I just gave up my Adobe subscription so was looking for a quick, free, command line PDF tool. This handles some needs very well. It doesn't do any OCR. It isn't very sophisticated. But it's handy for what it does.

If anyone has a better command line pdf tool, on the cheap, I'd love to hear about it.

Sometimes for the kind of thing I use this for, I have made Booklets in comic book formats instead: .cbz = .zip, but just stored images in a zip file with a changed extension name; .cbr same, but in .rar format. This can actually be pretty handy - and readers are easily available. I often do it on my Android phone (I highly recommend "Perfect Viewer" as a reader). One advantage of a comic book format is it's trivial to extract the images if you need one or all again. PDFs are more convenient within XY mostly because one can get a nice preview. Sumatra PDF can read comic book format on Windows. If you have a touchscreen (but you don't need one), and don't mind running an app from the Windows store, Pico Viewer is quite nice for a simple, dedicated viewer with some good features, and it's cheap. There are many others.

For either format, don't depend on Windows rotate to work. I run rotated images (and many others) through another utility that actually saves the file. I'm not sure what some programs are looking at for orientation, but using Win Photos rotate from WE doesn't handle things correctly.

I hope someone finds this useful - at the very least the project link page below.

Code: Select all

"Create PDF from ALL JPGs in Folder|||"
//Home page of project: https://sourceforge.net/projects/jpeg2pdf/
//You can add handwritten comments to PDF scans (over original images) with xournal: http://xournal.sourceforge.net/ <- I haven't tried this.

//Customize:
  $wait = 500;//Wait time for your machine before refresh. Mine will create a 200 pg pdf on an external SSD with this timing.
  $folderPath = "<xydata>\Programs"; //Path to the installer-less executable jpeg2pdf.exe. Don't end with a slash.
//Body
  run """$folderPath\jpeg2pdf.exe"" *.jpg -p auto -r both -o Booklet.pdf"; //Glance at the help to change or understand the settings.
  wait $wait;
  #1001; //Refresh

RalphM
Posts: 1338
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: I find this tiny little utility for creating PDFs from JPGs Useful

Post by RalphM » 17 May 2020 15:38

Maybe someone move this to Other Software?
Ralph :-)
(OS: W10 1909 Home x64 - XY: Current beta - Office 2019 32-bit)

Post Reply