6 06 2016
printing bing ads invoices with cups / lp: white pages
tried printing Microsoft’s BingAds invoices with lp/cups. Result: prints blank pages 😉
Solution: run through imagemagick’s “convert”. gives a warning (see below), but works:
ATTENTION:
New, better solution (way faster!). The old solution stopped working (upgraded to Ubuntu 16.04 und changed cups printer setup. can’t tell what exactly was breaking it):
pdftk "$infile" output "$outfile" flatten
So basically i’m running something like this on every PDF:
function processpdf { infile=$1 outfile=$2 mshit=`grep -m 1 -o "Microsoft Reporting Services PDF Rendering" "$infile"` if [ -z "$mshit" ] then echo "Not a Microsoft PDF, skipping ..." mv "$infile" "$outfile" else echo "Fixing Microsoft PDF mess ..." #echo convert -density 1200x1200 "$infile" "$outfile" #convert -density 1200x1200 "$infile" "$outfile" pdftk "$infile" output "$outfile" flatten rm "$infile" fi } export -f processpdf find /tmp/bingads/ -type f -name '*.pdf' -exec /bin/bash -c 'processpdf {} {}.fixed.pdf' \;
“Person who say it cannot be done should not interrupt person doing it.” –Chinese Proverb btrfs compression
Comments are currently closed.