| View previous topic :: View next topic |
| Author |
Message |
egerlach General User

Joined: 04 Nov 2007 Posts: 11 Location: Germany , Karlsruhe
|
Posted: Mon Jul 14, 2008 2:41 pm Post subject: print to postscript (not export to eps!!) |
|
|
Hi,
somebody here who can tell me how to print a document (writer, draw, ..) to as postscript file? - The printer dialog offers "print to file" option. Thats exactly what I want to realise in BASIC code: I press the key F10 an I find a file with a fix filename (e.g. myprint.ps in /tmp/-directory (linux))
BTW: I don't want to export to eps!! .. like demonstrated in that snippet:
http://www.oooforum.org/forum/viewtopic.phtml?t=6769&highlight=postscript+eps
Furthermore I want a code like this:
http://www.oooforum.org/forum/viewtopic.phtml?t=3388&highlight=printer
| Code: |
'******************************************************************
'Author: Andrew Pitonyak
'email: andrew@pitonyak.org
Sub PrintCurrentDocument
Dim mPrintopts1(), x as Variant
'Dimensioned at 0, if you set any other properties, be certain to set this to a higher value....
'Dim mPrintopts2(0) As New com.sun.star.beans.PropertyValue
Dim oDocument As Object, oPrinter As Object
oDocument = ThisComponent
'***********************************
'Do you want to choose a certain printer
Dim mPrinter(0) As New com.sun.star.beans.PropertyValue
mPrinter(0).Name="Name"
mPrinter(0).value="Other printer" ' insert name of your printer
oDocument.Printer = mPrinter()
'***********************************
'To simply print the document do the following:
oDocument.Print(mPrintopts1())
'***********************************
End Sub
|
adapted to print to /tmp/myprint.ps.
tia
Eckard |
|
| Back to top |
|
 |
DVezina OOo Advocate

Joined: 29 Sep 2006 Posts: 248 Location: Orlando
|
Posted: Wed Jul 16, 2008 11:31 am Post subject: |
|
|
To emulate Print to File do this:
| Code: |
'******************************************************************
'Author: Andrew Pitonyak
'email: andrew@pitonyak.org
Sub PrintCurrentDocument
Dim mPrintopts1(), x as Variant
'Dimensioned at 0, if you set any other properties, be certain to set this to a higher value....
'Dim mPrintopts2(0) As New com.sun.star.beans.PropertyValue
Dim oDocument As Object, oPrinter As Object
oDocument = ThisComponent
'***********************************
'Do you want to choose a certain printer
Dim mPrinter(0) As New com.sun.star.beans.PropertyValue
mPrinter(0).Name="Name"
mPrinter(0).value="Adobe PostScript" ' insert name of your PS printer
oDocument.Printer = mPrinter()
Dim mPrintopts1(0) As New com.sun.star.beans.PropertyValue
mPrintopts1(0).Name = "FileName"
mPrintopts1(0).Value="c:/filename.ps"
oDocument.Print(mPrintopts1())
End Sub
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|