
Source (link to git-repo or to original if based on someone elses unmodified work):
Description:
Converts images to pdfs with one click.
You can select many images that either will be converted to one single PDF file, or alternatively each image results in a separate PDF (see screenshots).
See https://www.opencode.net/dahoc/image2pdf/blob/master/README.adoc for Readme,
https://www.opencode.net/dahoc/image2pdf/blob/master/INSTALLATION.adoc for installation instructions,
https://www.opencode.net/dahoc/image2pdf/blob/master/CHANGELOG.md for Changelog.
Installation for KDE5/Plasma:
Use Dolphin > Settings > Context menus > Download > Search for image2pdf
For alternative ways to install see the linked Readme file.
Preconditions:
- You need to have the img2pdf (https://github.com/josch/img2pdf) package installed because this script depends on it for conversion.
Enjoy! Last changelog:
You can select many images that either will be converted to one single PDF file, or alternatively each image results in a separate PDF (see screenshots).
See https://www.opencode.net/dahoc/image2pdf/blob/master/README.adoc for Readme,
https://www.opencode.net/dahoc/image2pdf/blob/master/INSTALLATION.adoc for installation instructions,
https://www.opencode.net/dahoc/image2pdf/blob/master/CHANGELOG.md for Changelog.
Installation for KDE5/Plasma:
Use Dolphin > Settings > Context menus > Download > Search for image2pdf
For alternative ways to install see the linked Readme file.
Preconditions:
- You need to have the img2pdf (https://github.com/josch/img2pdf) package installed because this script depends on it for conversion.
Enjoy!
v1.6
- Fixed generating into single pdf by switching from sh to bash for this script and fixing passing of selected files
- Fixed check for img2pdf
Ratings & Comments
22 Comments
Works perfectly even for multiple images to single PDF. On neon 5.19 (18.04 base). I did not have to touch imagemagick permissions either.
Just one little thing. Dialog popup says: "$count image(s) into single pdf '$targetFileName' converted!" which is "German" construction :·) Maybe it should say $count image(s) converted to single pdf '$targetFileName' ;·)
Indeed, that was very German :-) Thank you for bringing this up, I fixed it: "Converted $count image(s) into '$targetFileName'"
9 9 excellent Just what I needed! The "export to single pdf" option is not working but it's not that I needed it, separate files are good enough. :)
Thank you! The new version should work, also it now reports errors - if it still does not work please feel free to paste the error here :-)
ImageMagic-6 on Ubuntu 18.04 now does not grant permission to edit PDF files through convert by default. I updated the Exec to check the result of the convert and display an error telling the user that might be the cause if convert fails. Here it is: Exec=a="'%F'"; namewithoutext="${a%.*}"; namewithextpdf="$namewithoutext.pdf"; count=0; for f in %F; do fdir=$(dirname "$f"); count=`expr $count + 1`; done; cd "$fdir"; newname=$(kdialog --getsavefilename "$fdir" "*.pdf |PDF files"); if [ $? -eq 0 ]; then result=$(convert %F "$newname" 2>&1); if [ $? -eq 0 ]; then kdialog --title "image2pdf" --passivepopup "$count image(s) into single pdf '$newname' converted!"; else kdialog --title "Conversion Failure" --msgbox "The conversion failed, probably because you have not configured permissions for ImageMagic in /etc/ImageMagic-6/policy.xml."; fi; else echo "Aborted"; fi;
Thank you! I adapted the script to display the underlying Imagemagick message in case of error, and added a troubleshooting section to the new repository Readme for the lacking policy permission issue
After placing it in ~/.local/share/kservices5/ServiceMenus/ or /usr/share/kservices5/ServiceMenus/ Dolphin is still not showing the Service Menu. Is there anything you can do about it?
Thank you for your message. I am also using Kubuntu 15.10 and Dolphin also showed no ServiceMenus for me. I updated the description with instructions on how to install in KDE5/Plasma and a fix for Dolphin to show ServiceMenus which worked for me.
It works as a charm! I also forgot it depends on imagemagick, so after installing that and following your instructions I could finally use my beloved service that's been making my life easy since 2010 (®) :)
In the spanish translation, in the "[Desktop Action image2pdf]" tag (separate pdf's) could you please add (separados) at the end of the line? it's just because it can be a little confusing to use, because it's hard to difference between separate pdf or single pdf. It could be something like that: right now: "Name[es]=Convertir archivo(s) de imagen en archivo(s) pdf" proposed: "Name[es]=Convertir archivo(s) de imagen en archivo(s) pdf (separados)"
Thank you!
Does not seem to work with 4.9.2, at least the actions are not shown to me :( EDIT: forget it, my fault, works perfectly.
Thaks a lot Name=Convert image(s) to separate pdf Name[ru]=Конвертировать в отдельные pdf Name=Convert image(s) into single pdf Name[ru]=Конвертировать в единый pdf
Thaks a lot Name=Convert image(s) to separate pdf Name[it]=Конвертировать в отдельные pdf Name=Convert image(s) into single pdf Name[ru]=Конвертировать в единый pdf
For me on 4.5.5 it reports 0 files (e.g. index of them is zero in the notify message displayed just after converting two files into one pdf). The idea is very good, this thing is very usable and still very easy to use. I hope you correct it a bit... Have a nice day! :)
Name=Convert image(s) to separate pdf Name[it]=Converti immagini in pdf separati Name=Convert image(s) into single pdf Name[it]=Converti immagini in un singolo pdf Thank you for your good work!
Thx for this service menu. In Spanish, - Name=Convert image(s) to separate pdf Name[es]=Convertir archivo(s) de imagen en archivo(s) pdf - Name=Convert image(s) into single pdf Name[es]=Convertir archivo(s) de imagen en un archivo pdf
Thx for this service menu. Just a note: we can add in [Desktop Entry] section : TryExec=convert If convert is not found, then the service menu is hidden. In French, - Name=Convert image(s) to separate pdf Name[fr]=Convertir l'(les) image(s) au format pdf - Name=Convert image(s) into single pdf Name[fr]=Convertir l'(les)image(s) dans un fichier pdf unique
I added your proposed changes, thank you!
Hello, In my previous message, I have not seen a mistake in the translation. I have forgotten a space between "l'(les)" and "image(s)" : Name=Convert image(s) into single pdf Name[fr]=Convertir l'(les) image(s) dans un fichier pdf unique Sorry... :$
Corrected!