joinpdf: merge images with different extensions in one pdf

General discussion about software packages and releases, new software you've found, and threads by programmers and script writers.

Moderator: peterZ

Post Reply
User avatar
dingodog
Posts: 110
Joined: 22 Jul 2010, 18:19
Number of books owned: 1000
Country: on the net
Location: on the net
Contact:

joinpdf: merge images with different extensions in one pdf

Post by dingodog »

I discovered some time ago this interesting page:
http://onetransistor.blogspot.it/2014/1 ... -size.html

regarding book scanning workflows

this page contained a snippet of C code based on leptonica library that makes able to build a binary utility able to merge together into ine pdf, files with different extension at once

Code: Select all

#include <leptonica/allheaders.h>
#include <stdio.h>

int main(int argc, char *argv[]){
    if (argc < 3) {
        printf("Not enough arguments specified!\njoinpdf <input_folder> <output_pdf>\n");
        exit(1);
        }
    if (argc > 3) printf ("Too many arguments!\nOnly the first two will be taken into account.\n");

    int r = convertFilesToPdf(argv[1], NULL, 0, 1, 0, 0, NULL, argv[2]);
    if (r == 0) printf ("%s successfully written!\n", argv[2]);
    else printf("Conversion failed");
}

for people unable to compile I compiled a binary (made portable with magicermine that I own a pro license) that hopefully is working into any linux environment that i attach to my post on forum

joinpdf-portable
md5sum
6a30df415fbc87ecc7fc2d56d9704ad0 joinpdf-portable.bz2
sha1
0ccbe40235120843318e72538344d19848eff637 joinpdf-portable.bz2

I compiled leptonica library with

jpeg, png, gif, tiff, jpeg-2000 support (via openjpeg2)

so my binary is able to put all these file extension in a pdf

syntax:

Code: Select all

joinpdf <input_folder> <output_pdf>
Attachments
joinpdf-portable.bz2
(1.9 MiB) Downloaded 437 times
Post Reply