summarylogtreecommitdiffstats
path: root/encryptpdf.desktop
diff options
context:
space:
mode:
Diffstat (limited to 'encryptpdf.desktop')
-rw-r--r--encryptpdf.desktop33
1 files changed, 33 insertions, 0 deletions
diff --git a/encryptpdf.desktop b/encryptpdf.desktop
new file mode 100644
index 000000000000..c79234dbc728
--- /dev/null
+++ b/encryptpdf.desktop
@@ -0,0 +1,33 @@
+[Desktop Entry]
+Type=Service
+ServiceTypes=KonqPopupMenu/Plugin
+MimeType=application/pdf;
+Actions=encryptPdf
+
+[Desktop Action encryptPdf]
+Name=Encrypt PDF-File to make it Password-Protected
+Icon=application-pdf
+Exec=/bin/bash -c 'Confirmation="1"; InputFile="$0"; TmpFile="/tmp/ServiceMenu_addPDFPasswd.pdf"; Program="pdftk"; if command -v $Program > /dev/null 2>&1 ; then Passwd=`kdialog --password "Set password for the PDF:"`; $Program "$InputFile" output "$TmpFile" user_pw "$Passwd"; mv "$InputFile" "$InputFile.org"; mv "$TmpFile" "$InputFile"; if [ "$Confirmation" -eq 1 ] ; then kdialog --msgbox "Password added to selected File\nOriginal was was renamed to .org"; fi else kdialog --error "$Program could not be found. Please install $Program"; fi' %u
+
+
+
+########################################### The actual script shown nicely #######################################
+#
+#
+#Confirmation="1";
+#InputFile="$0";
+#TmpFile="/tmp/ServiceMenu_addPDFPasswd.pdf";
+#Program="pdftk";
+#if command -v $Program > /dev/null 2>&1 ;
+#then
+# Passwd=`kdialog --password "Set password for the PDF:"`;
+# $Program "$InputFile" output "$TmpFile" user_pw "$Passwd";
+# mv "$InputFile" "$InputFile.org";
+# mv "$TmpFile" "$InputFile";
+# if [ "$Confirmation" -eq 1 ] ;
+# then
+# kdialog --msgbox "Password added to selected File\nOriginal was was renamed to .org";
+# fi
+#else
+# kdialog --error "$Program could not be found. Please install $Program";
+#fi' %u