[cups] IP110 printer left margin too small Kubuntu 16.04
Xen
list at xenhideout.nl
Thu May 5 12:46:09 PDT 2016
Hans van der Leeuw schreef op 05-05-2016 21:28:
> Hello Bart,
> I'm not really familiar with Cups. I did not got it working with my
> Canon
> lbp5000. I have the impression that just a few people are very familiar
> with Cups.
> Just to keep you going; may be a macro in LO can do the trick?
> Google for: LO macro opnemen.
> Works for Writer as well.
I don't need only LibreOffice. Ik heb niets aan alleen LibreOffice.
Hoewel een macro dat makkelijker zou kunnen maken maar het veranderen
van de marges in het LibreOffice document zelf is ook niet prettig. And
I don't know if those macro's would be able to effect the printer real
margins either, or anyway.
Currently writing some scripts to do it. Here they are thus far:
shiftright.sh:
#!/bin/bash
if [ -n "$1" ]; then
echo
echo "Input is $1"
nopdf=${1%.pdf}
newname="${nopdf}-shifted.pdf"
echo "Transforming to $newname"
gs \
-q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER \
-dCompatibilityLevel="1.3" -dPDFSETTINGS="/printer" \
-dSubsetFonts=true -dEmbedAllFonts=true \
-sPAPERSIZE=a4 -sOutputFile="$newname" \
-c "<</BeginPage{21.5 0 translate}>> setpagedevice" \
-f "$1"
fi
printshifted.sh:
#!/bin/bash
[ -n "$1" ] && {
echo
echo "Transforming input $1 for opening in Okular and printing using
IP110"
while read f; do {
res=$(echo "$f" | grep "Transforming to")
if [ -n "$res" ]; then
res=$(echo "$f" | { read a b c; echo "$c"; })
echo "The output will be found in $res"
fi
} done < <(./shiftright.sh "$1")
echo "Not aware of any exit status, but opening in Okular..."
okular "$res" &
}
Still need to put them in my path. Depending on how long "gs" takes I
may now have almost instantly a transformed PDF open in Okular that I
can print as usual with the right margins coming out.
Maybe a bit convoluted, I wanted to say, but this way my script can give
a live report of the other script. I just don't know the exit status
unless I grep it too ;-).
It uses that trick to get around the issue that variables are not
accessible if you put them in a subshell loop.
Regards.
More information about the cups
mailing list