streamlet-examples/pdfinfo
branchv_0
changeset 70 018e2609f5bb
parent 50 22ed5647b235
--- a/streamlet-examples/pdfinfo	Tue Jan 28 23:35:25 2020 +0100
+++ b/streamlet-examples/pdfinfo	Wed Jan 29 00:58:37 2020 +0100
@@ -58,9 +58,8 @@
 	for (( i=0; i<${#pdfFields[@]}; i++)); do
 		value="$(echo "$pdfInfo" | grep -P "^\Q${pdfFields[$i]}\E:" | sed -E 's/[^:]+:\s+(.*)/\1/g' | tr -d '\n';)"; # the field name must not contain "\E"
 
-		if  ([[ ! "x$pdfValid" == "x0" ]] || [[ "x$value" == "x" ]]) && [[ "x${pdfFields[$i]}" == "xPages" ]]; then value="0"; isNull="true";
-		elif [[ ! "x$pdfValid" == "x0" ]];                                                                     then value="";  isNull="true";
-		else                                                                                                                   isNull="false";
+		if [[ ! "x$pdfValid" == "x0" ]] || [[ "x$value" == "x" ]]; then isNull="true";
+		else                                                            isNull="false";
 		fi
 
 		send OUTPUT_ATTRIBUTE "$value"    "$isNull";