What I do:
import uno
from com.sun.star.view.PaperOrientation import PORTRAIT as PAPER_ORIENTATION_PORTRAIT
from com.sun.star.view.PaperOrientation import LANDSCAPE as PAPER_ORIENTATION_LANDSCAPE
from com.sun.star.view.PaperFormat import A4 as PAPER_FORMAT_A4
from com.sun.star.view.DuplexMode import OFF as DUPLEX_MODE_OFF
from com.sun.star.view.DuplexMode import LONGEDGE as DUPLEX_MODE_LONGEDGE
from com.sun.star.view.DuplexMode import SHORTEDGE as DUPLEX_MODE_SHORTEDGE
from com.sun.star.beans import PropertyValue
printer = 'Canon MF650C Series UFR II(1)'
def print():
doc = XSCRIPTCONTEXT.getDocument()
doc.Printer = mkpvseq({
'Name': printer,
'PaperOrientation': PAPER_ORIENTATION_PORTRAIT,
'PaperFormat': PAPER_FORMAT_A4,
})
doc.PagePrintSettings = mkpvseq({
'PageColumns': 2,
'PageRows': 1,
'IsLandscape': True,
})
doc.printPages(mkpvseq({
'CopyCount': 1,
'Pages': '',
'DuplexMode': DUPLEX_MODE_OFF,
'PrinterName': printer,
}))
def mkpvseq(props):
pvs = []
for n, v in props.items():
pv = PropertyValue()
pv.Name = n
pv.Value = v
pvs.append(pv)
return tuple(pvs)
g_exportedScripts = print,
Basically printing works, but in this particular case it prints 2 pages on different sides of a sheet. How do I make it print 2 pages on one side of a sheet? What can I check? Any suggestions?