Bug 252462 - Add command line option to print document
Summary: Add command line option to print document
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Unclassified
Component: general (show other bugs)
Version: 0.10.5
Platform: Debian unstable Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-26 20:12 UTC by Thomas Friedrichsmeier
Modified: 2013-03-11 21:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Friedrichsmeier 2010-09-26 20:12:30 UTC
Version:           0.10.5 (using KDE 4.4.4) 
OS:                Linux

It would be very handy to have a command-line option "--print" which would automatically bring up the printing dialog after opening the document. This would allow okular to be used for printing from non-KDE applications, similar to the KDE 3's kprinter or xpp.

Reproducible: Didn't try
Comment 1 tusko5 2011-09-12 09:43:45 UTC
You can do something similar with dcop. I have created the following script:

# okular assume stdin input
TEMP=$(mktemp)
cat >$TEMP
okular $TEMP &
OKULAR=org.kde.okular-$!
until [ $(qdbus | grep $OKULAR) = $OKULAR ]
do
  sleep 1s
done
qdbus $OKULAR /okular/okular__Shell/actions/file_print com.trolltech.Qt.QAction.trigger
qdbus $OKULAR /okular/okular__Shell/actions/file_quit com.trolltech.Qt.QAction.trigger
rm $TEMP
Comment 2 Albert Astals Cid 2013-03-11 21:53:11 UTC
Git commit 5ab30aae15ac69e030695b22a008001426e8cdca by Albert Astals Cid, on behalf of Tomáš Poledný.
Committed on 11/03/2013 at 22:52.
Pushed by aacid into branch 'master'.

Open print dialog from command line
REVIEW: 109096
FIXED-IN: 4.11.0
GUI

M  +17   -1    part.cpp
M  +3    -0    part.h
M  +3    -0    shell/main.cpp
M  +6    -2    shell/shell.cpp

http://commits.kde.org/okular/5ab30aae15ac69e030695b22a008001426e8cdca