I have tried to use img2pdf for my project because I really like its features. What I have done is to scan a photo album. For several reasons, I have now not only right and left pages but also every page has a different size (pixels: WxL) but is supposed to have the same geometry (cm: WxL) so they have all different resolution (dpi).
What I would like to do now is to compile all the images (one page each) into one pdf such that the images of the left pages are right aligned and the right images left-aligned (not centered) and centered in vertical direction.
Additionally, it would be great if img2pdf would find the page with the maximum or minimum (geometrical) size and use this as a reference for pagesize, so that the final album has the same page size for all pages without me having to find the right value.
The album pages have been scanned on a black background. It would therefore be ideal if there were an option to set the background color.
Thank you for your interest in img2pdf! Unfortunately I think your request is just too specific. Think about it: how many other people will be in a similar situation as you are -- can you say with confidence, that your use-case is common enough such that it is worth the additional complexity of img2pdf?
Lets go through your wish-list one-by-one:
You would like to have a facility which allows one to align images on the left or right. How would this look like such that the functionality is general enough to not only be useful in your case but in the general case? You would have to include a few additional command line options and probably some sort of layout language which allows you to define rules like "align like this on even numbered pages" and "align like that on odd numbered pages". I think you are better served by whipping up a quick LaTeX document where you use the right document class to achieve your desired layout. (LaTeX is also lossless for the jpeg images you embed)
You also would like to set a background color. For how many people would that be useful? It is not useful for archival purposes because the background color is irrelevant for reading on the screen. It is undesirable for printing the result because it would waste a lot of ink to print a non-white background color. But lets say you add an option. Next time somebody comes and says "but for my use case, I need color X on pages 1-5 and color Y on pages 6 to 10" -- so yet another option for that?
The more features you add the harder it becomes to use a tool because more documentation has to be added. More documentation means that the tool is harder to understand. Apparently the existing documentation is already hard enough to understand that you didn't see that one of your feature requests is already possible today -- which proves my point.
So what you have to convince me of is: what you request a common enough use-case such that it's worth implementing it? Or is what you want just specific to what you personally want?
I thnk you are wrong. Setting the alignment of the image ("x cm from the left", "centered vertically") is a common use case. I don't need you to add any "align like that on odd numbered pages", I can fairly join the pdf paged afterwards with pdfjam, but I can not move the images around easily (particularly not lossless).
On the background color: Just search google for how many forum entries they are asking for that.
I program myself. I seriously doubt that in a well designed progra, it adds ANY complexity to add another option that outputs a single additional statement into the pdf file. There is nothing more trivial than that. And again: I can join the pdf files afterwards.
Sure I can setup LaTeX documents... but is it fairly easier to process my stuff with a bash script than creating almost a hundred LaTeX documents manually or automatically. I wonder what the use case of img2pdf is then at all ... it might be generally quicker and more flexible to just comiule a LaTeX document. Maybe you should add some instructions for that on your page.
Cool! It seems we have found ourselves a volunteer to implement the missing features. :)
My advice to move forward is the following: split your feature requests into individual issues so that we can tackle each of them by itself without conflating all of them into a big mess. Then open a merge request that implements the functionality you want. Remember that any new feature needs documentation and test cases.
Same goes for any possible recipe like instructions for how to combine the output with LaTeX. We can easily add that to the
README.mdor create wiki pages in this gitlab instance -- again, just open a merge request about it.
Hi @rtlprmft -- did you find some time to work on the missing features you listed? I'm about to make a new release and was wondering whether you had some contributions already or not. Thanks!