Re: [api-dev] How to set print to file

2006-03-03 Thread Jürgen Schmidt


Mathias Bauer wrote:

Alexandro Colorado wrote:


I got a macro which prints a document:

dispatcher.executeDispatch(document, .uno:PrintDefault, , 0, Array())

However I was unable to find an interface for printing to a document,  
doing some research on the reference I found the FileName which is used in  
case of printing to a file but I couldnt find any other option to set it  
as a PrinttoFile.


The models of all OOo documents support com.sun.star.view.XPrintable.
There you find a method print that allows to add parameters as
PrintOptions.

In Basic you can write

dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = FileName
args(0).Value = sFileName

ThisComponent.print(args())

Please note that sFileName must be a system file name, not a URL,
because it will be handed over to the printing API of the OS.


After a short discussion with Mathias and a look into the code, i can 
say that URLs are allowed.


Juergen




Best regards,
Mathias



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] How to set print to file

2006-03-02 Thread Alexandro Colorado

I got a macro which prints a document:

dispatcher.executeDispatch(document, .uno:PrintDefault, , 0, Array())

However I was unable to find an interface for printing to a document,  
doing some research on the reference I found the FileName which is used in  
case of printing to a file but I couldnt find any other option to set it  
as a PrinttoFile.


--
Alexandro Colorado
CoLeader of OpenOffice.org ES
http://es.openoffice.org

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to set print to file

2006-03-02 Thread Mathias Bauer
Alexandro Colorado wrote:

 I got a macro which prints a document:
 
 dispatcher.executeDispatch(document, .uno:PrintDefault, , 0, Array())
 
 However I was unable to find an interface for printing to a document,  
 doing some research on the reference I found the FileName which is used in  
 case of printing to a file but I couldnt find any other option to set it  
 as a PrinttoFile.

The models of all OOo documents support com.sun.star.view.XPrintable.
There you find a method print that allows to add parameters as
PrintOptions.

In Basic you can write

dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = FileName
args(0).Value = sFileName

ThisComponent.print(args())

Please note that sFileName must be a system file name, not a URL,
because it will be handed over to the printing API of the OS.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]