I witnessed the same problem when switching from openoffice (Debian stable) to libreoffice (debian stable with backports).
I have written a BASIC macro that works perfectly in our office and in the office where my wife works, with the following code:
[CODE]
DIM oDoc AS Object
oDoc = ThisComponent
REM Set backgroundImage-option in DocumentSettings to False
DIM oSettings AS Object
oSettings = oDoc.createInstance("com.sun.star.text.DocumentSettings")
oSettings.PrintPageBackground = bBg1
REM choose a certain printer
DIM mPrinterOpts(3) AS NEW com.sun.star.beans.PropertyValue
mPrinterOpts(0).Name = "Name"
mPrinterOpts(0).Value = "MFC8880DN"
mPrinterOpts(1).Name = "PaperFormat"
mPrinterOpts(1).Value = com.sun.star.view.PaperFormat.A4
mPrinterOpts(2).Name = "PaperOrientation"
mPrinterOpts(2).Value = com.sun.star.view.PaperOrientation.PORTRAIT
oDoc.Printer = mPrinterOpts()
REM set Papertray in Styles
DIM oStyle AS Object
DIM sPageStyle AS String
sPageStyle = oDoc.CurrentController.getViewCursor().PageStyleName
ostyle = oDoc.StyleFamilies.getByName("PageStyles").getByName(sPageStyle)
oStyle.PrinterPaperTray = sTray
REM Set printOptions
DIM mPrintOpts(3) AS NEW com.sun.star.beans.PropertyValue
mPrintOpts(0).Name = "CopyCount"
mPrintOpts(0).Value = 1
mPrintOpts(1).Name = "Collate"
mPrintOpts(1).Value = True
mPrintOpts(2).Name = "Pages"
mPrintOpts(2).Value = sPageNr
mPrintOpts(3).Name = "Wait"
mPrintOpts(3).Value = True
REM Print
oDoc.Print(mPrintOpts())
[/CODE]
This worked perfectly with Openoffice.org v3.2.1. When I upgraded to LibreOffice in backports (first v3.3, now v 3.4.3 OOO340m1 build 302), this stopped working.
printing complete documents to tray 1 WORKS
printing complete documents to tray 2 WORKS
printing the first page to tray 1 and following pages to tray 2 DOES NOT WORK.
Maybe this is related to the bug at hand, and it might even help solving this bug (and my problem ;-)) - to that end, I will be crossposting this info to bug #39220
I witnessed the same problem when switching from openoffice (Debian stable) to libreoffice (debian stable with backports).
I have written a BASIC macro that works perfectly in our office and in the office where my wife works, with the following code:
[CODE]
DIM oDoc AS Object
oDoc = ThisComponent
REM Set backgroundImage -option in DocumentSettings to False ance("com. sun.star. text.DocumentSe ttings" ) PrintPageBackgr ound = bBg1
DIM oSettings AS Object
oSettings = oDoc.createInst
oSettings.
REM choose a certain printer star.beans. PropertyValue 0).Name = "Name" 0).Value = "MFC8880DN" 1).Name = "PaperFormat" 1).Value = com.sun. star.view. PaperFormat. A4 2).Name = "PaperOrientation" 2).Value = com.sun. star.view. PaperOrientatio n.PORTRAIT
DIM mPrinterOpts(3) AS NEW com.sun.
mPrinterOpts(
mPrinterOpts(
mPrinterOpts(
mPrinterOpts(
mPrinterOpts(
mPrinterOpts(
oDoc.Printer = mPrinterOpts()
REM set Papertray in Styles troller. getViewCursor( ).PageStyleName ies.getByName( "PageStyles" ).getByName( sPageStyle) PrinterPaperTra y = sTray
DIM oStyle AS Object
DIM sPageStyle AS String
sPageStyle = oDoc.CurrentCon
ostyle = oDoc.StyleFamil
oStyle.
REM Set printOptions star.beans. PropertyValue 0).Value = 1 1).Value = True 2).Value = sPageNr 3).Value = True
DIM mPrintOpts(3) AS NEW com.sun.
mPrintOpts(0).Name = "CopyCount"
mPrintOpts(
mPrintOpts(1).Name = "Collate"
mPrintOpts(
mPrintOpts(2).Name = "Pages"
mPrintOpts(
mPrintOpts(3).Name = "Wait"
mPrintOpts(
REM Print mPrintOpts( ))
oDoc.Print(
[/CODE]
This worked perfectly with Openoffice.org v3.2.1. When I upgraded to LibreOffice in backports (first v3.3, now v 3.4.3 OOO340m1 build 302), this stopped working.
printing complete documents to tray 1 WORKS
printing complete documents to tray 2 WORKS
printing the first page to tray 1 and following pages to tray 2 DOES NOT WORK.
Maybe this is related to the bug at hand, and it might even help solving this bug (and my problem ;-)) - to that end, I will be crossposting this info to bug #39220