Create a link on desktop that prints a specific textfile when clicked

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Cevyn

Create a link on desktop that prints a specific textfile when clicked

Post by Cevyn »

Hi,
I have another weird question for you guys to break your brains on! :roll:

My boss want to have a desktop shortcut that sends a specific textfile (.odt) directly to the printer :?
(So without opening the file in libre-office and printing it from there) to make it idiot-proof for my colleages. :mrgreen:

I have found several options but they all require user interaction like dropping a file in a printer link on the desktop etc.
Thanks in advance for any tips!!
Kevin
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: Create a link on desktop that prints a specific textfile when clicked

Post by xenopeek »

Command libreoffice -p "/path/to/filename.odt" should hopefully work to print the file to the default printer. If you need to specify a specific printer use libreoffice --pt "printername" "/path/to/filename.odf" instead.

Test the command first and if it does what you need the next step is to turn it into a script. Scripts usually ask the user what to do with them when executed. It should be simple enough to instead make a short program in a compiled language to call that command so that there is no user confirmation. Any programming languages you already use or have on your system?
Image
Locked

Return to “Other topics”