Browse Source

Changed: all2pdf

Jonas Nickl 6 years ago
parent
commit
689f580573
1 changed files with 25 additions and 7 deletions
  1. 25 7
      all2pdf

+ 25 - 7
all2pdf

@@ -21,7 +21,7 @@ chooseDPI() {
 	while [ "$DPI" == 0 ] 
 	do	
 		#DPI=`zenity --list --title="$title" --text="Choose DPI" --width=680 --height=270 --column="Value" --column="DPI" 72 72 150 "150 (default)" 300 300`
-        	DPI=`zenity --list --title="$title" --text="Choose DPI" --width=100 --height=270 --column="DPI" 72 150 300`
+        	DPI=`zenity --list --title="$title" --text="Choose DPI" --width=100 --height=270 --column="DPI" 72 150 300 noChange`
 
 		[ $? -ne 0 ] && exit 2
 	done
@@ -37,11 +37,13 @@ chooseDinSize() {
 
 	while [ ! "$DINNORM" ] 
 	do	
-		DIN_A3="`echo \"scale=0; \${DPI}*11.693333333/1\" | bc -l`x`echo \"scale=0; \${DPI}*16.536666667/1\" | bc -l`"
-		DIN_A4="`echo \"scale=0; \${DPI}*8.266666667/1\" | bc -l`x`echo \"scale=0; \${DPI}*11.693333333/1\" | bc -l`"
-		DIN_A5="`echo \"scale=0; \${DPI}*5.826666667/1\" | bc -l`x`echo \"scale=0; \${DPI}*8.266666667/1\" | bc -l`"
+#		DIN_A3="`echo \"scale=0; \${DPI}*11.693333333/1\" | bc -l`x`echo \"scale=0; \${DPI}*16.536666667/1\" | bc -l`"
+#		DIN_A4="`echo \"scale=0; \${DPI}*8.266666667/1\" | bc -l`x`echo \"scale=0; \${DPI}*11.693333333/1\" | bc -l`"
+#		DIN_A5="`echo \"scale=0; \${DPI}*5.826666667/1\" | bc -l`x`echo \"scale=0; \${DPI}*8.266666667/1\" | bc -l`"
+
+#		read DINNORM DINSIZE <<< $(zenity --list --print-column=ALL --separator=' ' --title="$title" --text="Choose Size" --width=680 --height=270 --column="Din Norm" --column="Format" NoChange nochange A3 $DIN_A3 A4 $DIN_A4 A5 $DIN_A5 )
+		DINNORM=`zenity --list --title="$title" --text="Choose Din Norm" --width=250 --height=270 --column="Din Norm" nochange A3 A4 A5 A6`
 
-		read DINNORM DINSIZE <<< $(zenity --list --print-column=ALL --separator=' ' --title="$title" --text="vdvds" --width=680 --height=270 --column="Din Norm" --column="Format" A3 $DIN_A3 A4 $DIN_A4 A5 $DIN_A5)
 
 		[ $? -ne 0 ] && exit 2
 	done
@@ -139,8 +141,24 @@ renameExtFiles() {
 createPDF() {
 
 #        convert -compress jpeg -resize !874x1240 -density 150x150 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "${1%\.pdf}_${compression}.pdf"
-        convert -compress jpeg -resize !${DINSIZE} -density ${DPI}x${DPI} -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "${FILE%\.*}_${DPI}_${DINNORM}.pdf"
 
+#        [ "${DINSIZE}" != "nochange" ] 	&& USE_DINSIZE="-resize !${DINSIZE} "
+        [ "${DINNORM}" != "nochange" ] 	&& USE_DINNORM="-page ${DINNORM}"
+	[ "${DPI}" != "noChange" ] 	&& USE_DPI="-density ${DPI}x${DPI} "
+	
+
+
+#	        convert -compress jpeg -resize !${DINSIZE} -density ${DPI}x${DPI} -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "${FILE%\.*}_${DPI}_${DINNORM}.pdf"
+#        convert -compress jpeg ${USE_DINNORM} ${USE_DPI} -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "${FILE%\.*}_${DPI}_${DINNORM}.pdf"
+#        convert -compress jpeg ${USE_DINNORM} -density 28.350000000000001421x28.350000000000001421 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "test.pdf"
+#        convert -compress jpeg ${USE_DINNORM} -density 300x300 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "test_300.pdf"
+#        convert -compress jpeg ${USE_DINNORM} -density 150x150 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "test_150.pdf"
+        convert -compress jpeg ${USE_DINNORM} -density 30x30 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "${FILE%\.*}_${DINNORM}.pdf"
+#        convert -compress jpeg ${USE_DINNORM} -density 10x10 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "test_10.pdf"
+#        convert -compress jpeg ${USE_DINNORM} -density 30x30 -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "test_3.pdf"
+#        convert -compress jpeg ${USE_DINNORM} -units PixelsPerInch $$/*g $$/*G $$/*/*g $$/*/*G $$/*/*f $$/*/*F "test_X.pdf"
+
+#${USE_DINSIZE}
 }
 
 #===  FUNCTION  ================================================================
@@ -160,7 +178,7 @@ cleanup() {
 #
 #===================================================================================
 
-chooseDPI
+#chooseDPI
 
 ## chooseDinSize
 chooseDinSize