Bug 252462

Summary: Add command line option to print document
Product: [Applications] okular Reporter: Thomas Friedrichsmeier <thomas.friedrichsmeier>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: wishlist CC: tusko5
Priority: NOR    
Version: 0.10.5   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.0

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