Hi Fernand, some weeks ago I spoke with some guys at OOo and they know this problem. Because of your mail, I did a quick search both at the OOo issue tracker and the LibreOffice issue tracker.
The only information (related to that) is: https://bugs.freedesktop.org/show_bug.cgi?id=33639 So please, go ahead and file and issue for that ... since you have some more insight, I'd like to ask you. But I'd also like to ask whether you could CC me (username "Christoph"). Once the bug is filed, I'll upload a document I did some time ago. I've started to analyze the print items stored in the ODF files. So even some versions ago, the office suite wasn't able to store half of the settings offered in the printing dialog (that resulted in a "funny" mixture of both saved / non-saved) items. Thanks in advance! Cheers, Christoph Am Donnerstag, den 10.03.2011, 12:43 +0100 schrieb Fernand Vanrie: > Hallo > > Sinds 3.3 (windows) all PrinterSettings except the Printer Names are no > longer persistent and not stored anywhere not in the profile, and not > in the document. Within the printer settings we have the "options" who > are not Printer specific and we have "Settings" who are bound to a > specific printer. Both are all lost after reloading the document, We > can use the Printer specific settings during but only when starting the > printing itself the choosen settings are remenbered as lo,ng the > document stays open. > > Setting the PageSizes using the API is also broken, please trie the > included code with a printer who accept to changes the PaperSizes > > PLease can someone confirm this, so i can fill a issue > > Greetz > > Fernand > > REM ***** BASIC ***** > Sub printdocument > Dim Doc As Object > doc = thiscomponent > Dim PrinterProperties(0) As New com.sun.star.beans.PropertyValue > Dim PaperSize As New com.sun.star.awt.Size > PaperSize.Width = 20000 ' corresponds to 20 cm > PaperSize.Height = 20000 ' corresponds to 20 cm > 'PrinterProperties (0).Name= "Name" > 'PrinterProperties (0).Value= "Adobe PDF" > PrinterProperties (0).Name="PaperFormat" > PrinterProperties (0).Value= 8 > 'PrinterProperties (1).Name="PaperSize" > 'PrinterProperties (1).Value= PaperSize > Doc.setPrinter(PrinterProperties()) > 'xray Doc.getPrinter > Doc.print(PrinterProperties()) > > Dim PrinterProps(1) As New com.sun.star.beans.PropertyValue > PrinterProps(0).Name="wait" > PrinterProps(0).value=true > PrinterProps(1).Name = "IsBusy" > > dim bIsBusy as boolean > bIsBusy = True > While bIsBusy > 'dim aPrintConditions as object > aPrintConditions = thiscomponent.getPrinter() > dim i as integer > For i = LBound( aPrintConditions ) To UBound( aPrintConditions ) > If aPrintConditions(i).Name = "IsBusy" Then > bIsBusy = aPrintConditions(i).Value > EndIf > Next > Wait 10 > wend > > DisplayPrinterProperties > > end sub > > Sub DisplayPrinterProperties > Dim Props 'Array of com.sun.star.beans.PropertyValue > Dim i% 'Index variable of type Integer > Dim s$ 'Display string > Dim v ' > Dim sName$ ' > On Error Resume Next > Props = ThisComponent.getPrinter() > For i = 0 To UBound(Props) > sName = props(i).Name > v = props(i).Value > s = s & sName & " = " > If sName = "PaperOrientation" Then > REM com.sun.star.view.PaperOrientation.LANDSCAPE also supported > s = s & IIf(v=com.sun.star.view.PaperOrientation.PORTRAIT,_ > "Portrait", "Landscape") & " = " & CStr(v) > ElseIf sName = "PaperFormat" Then > Select Case v > Case com.sun.star.view.PaperFormat.A3 > s = s & "A3" > Case com.sun.star.view.PaperFormat.A4 > s = s & "A4" > Case com.sun.star.view.PaperFormat.A5 > s = s & "A5" > Case com.sun.star.view.PaperFormat.B4 > s = s & "B4" > Case com.sun.star.view.PaperFormat.B5 > s = s & "B5" > Case com.sun.star.view.PaperFormat.LETTER > s = s & "LETTER" > Case com.sun.star.view.PaperFormat.LEGAL > s = s & "LEGAL" > Case com.sun.star.view.PaperFormat.TABLOID > s = s & "TABLOID" > Case com.sun.star.view.PaperFormat.USER > s = s & "USER" > Case Else > s = s & "Unknown value" > End Select > s = s & " = " & CStr(v) > ElseIf sName = "PaperSize" Then > REM type is com.sun.star.awt.Size > REM The size is in TWIPS and there are 1440 twips per inch > s=s & CDbl(v.Width)/1000 & "x" & CDbl(v.Height)/1000 & " (cm)" > Else > s = s & CStr(v) > End If > s = s & CHR$(10) > Next > s= "Sometimes the PrinterName is correct but never the wanted > papersize > of 20x20 cm " &CHR(10) & s > MsgBox s, 0, "Printer Properties" > > End Sub > > > -- Unsubscribe instructions: E-mail to discuss+h...@documentfoundation.org Archive: http://listarchives.documentfoundation.org/www/discuss/ *** All posts to this list are publicly archived for eternity ***