Command Line/Bash Script Printing - Can we select pages?

Issues with installing under all Linux Distributions

Command Line/Bash Script Printing - Can we select pages?

Postby stwschool » Wed Dec 10, 2008 3:54 am

Hi chaps, just wondering if you can help me. I'm trying to wean my fellow teachers from their Windows/MS Office addiction. So far it's going fairly well, and the web-based system I've built them for storing and printing their files (php script doing some stuff with OpenOffice on an Ubuntu 8.10 platform) is working well. My PHP script passes all the commands via terminal which is just fine. However, what I haven't yet figured out is choosing pages, and some of them are a bit too phobic to copy and paste a couple of pages into a new document and print that. If anyone has a solution whereby one can choose pages via the command line that would be fabulous. I'll take bash scripts too if that's the solution as I can easily have PHP generate it, make it executable and run it, not a problem.
OOo 3.0.X on Ubuntu 8.x + Vista
stwschool
 
Posts: 2
Joined: Wed Dec 10, 2008 3:48 am

Re: Command Line/Bash Script Printing - Can we select pages?

Postby acknak » Wed Dec 10, 2008 6:43 am

Choosing pages for what, printing?

I know you just explained it, but somehow I just can't get my head around what, exactly, your php system is providing. Can you distill it down to one clear sentence?
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Command Line/Bash Script Printing - Can we select pages?

Postby stwschool » Wed Dec 10, 2008 8:09 am

Ok I'll break it down.

In the GUI you would..
1. Open a document.
2. Print.
3. Choose to print pages 1,3 and 7.

I want to do the same using a command line or bash script. Can it be done? The PHP is probably irrelevant at this point, if I can get the command line, I can take care of the PHP. It's just a system I'm building to make the school more paper-efficient, and stop us from constantly losing important files (student's progress reports, exam results, etc) due to poor backup procedures, viruses, etc as happened before I got hold of things.


PS I just re-read my first post and you're right, it's complete gibberish. I do that sometimes, it's just how my brain's wired up, it blows a fuse sometimes!)
OOo 3.0.X on Ubuntu 8.x + Vista
stwschool
 
Posts: 2
Joined: Wed Dec 10, 2008 3:48 am

Re: Command Line/Bash Script Printing - Can we select pages?

Postby acknak » Wed Dec 10, 2008 5:33 pm

You can print a whole document from the command line:
soffice -p somedoc.odt

See soffice -help for more info on command line arguments:
...
-p <documents...>
print the specified documents on the default printer.
-pt <printer> <documents...>
print the specified documents on the specified printer.

I don't see any way to print only specified pages, though. That will probably require a little macro programming, and then your macro can be called from the command line--something like that. For details, I think you'll have to see the programming gurus over in the macro forums.

But... I'm afraid I still don't quite get it. Why do you need a web interface? Why can't people just print from the OOo GUI in the normal way?
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3


Return to Linux

Who is online

Users browsing this forum: No registered users and 2 guests