"Sent to Printer" in Unity?

Patrick Asselman iceblink at seti.nl
Mon Jan 14 08:57:19 UTC 2013


On 2013-01-13 11:29, Johnny Rosenberg wrote:
> 2013/1/13 Dotan Cohen <dotancohen at gmail.com>:
>> Is there any way to add a "Send to printer" option in Unity? A
>> coworker just moved to Ubuntu but often needs to highlight a dozen 
>> or
>> so files in the file manager and print them directly. These are MS
>> Word files, so I suspect that some LibreOffice component will be
>> necessary.
>>
>> Note that opening each file and pressing Print is impractical as 
>> there
>> are just too many documents and this is done too often. Windows has
>> the ability to "Sent to printer" directly from the file manager and
>> this user uses the functionality very, very often.
>>
>> Thanks.
>
> The same thing was discussed here:
> 
> http://askubuntu.com/questions/101756/how-do-i-print-a-batch-of-word-files-in-a-directory
>
>
> I doubt that it will work, though.
>
>
> Johnny Rosenberg
>

I would expect to find a lot of garble on many many pages at the 
printer.
But no doubt it can be modified slightly by using LibreOffice's 
"--print-to-file" option.

Something like...

#!/bin/bash
for i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
   mkdir -p /home/$USER/.print
   /opt/libreoffice3.4/program/soffice --print-to-file $i --outdir 
/home/$USER/.print
   lpr /home/$USER/.print/*
   rm -f /home/$USER/.print/*
done


I'm sure this can be improved, because it is probably not very secure 
and it may also be quite slow... but it's a start.

Best regards,
Patrick Asselman




More information about the ubuntu-users mailing list