openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ariel Constenla-Haile <>
Subject Re: odt2braille on the Mac
Date Fri, 28 Oct 2011 16:33:39 GMT
Hi Brett, *

On Fri, Oct 28, 2011 at 12:42:18PM +0200, Bert Frees wrote:
> Hello J├╝rgen and Ariel,
> Thanks for your help. I appreciate you want to solve this MacOS issue when
> there is more time.
> Ariel, the suggested code works :) I am now trying to find a way to send a
> byte stream to a printer. 

let me see if I get it: you are trying to print arbitrary stuff just
like in this java snippet

> Could XPrinterPropertySet.setBinarySetup be used
> for this purpose maybe? 

this method is for setting the Printer setup (that is, the printer
configuration), not for setting the data to be printed

> The service only seems to
> support graphical data, am I right?

mmm I've only used this to get the printer name, and then print an OOo
document, via the css.view.XPrintable interface implemented by OOo 
Printing in OOo is well supported for printing *office* documents (not 
any data you may want to print, let's say a PDF file, for example. If 
you want to print an arbitrary file, let's say a PNG picture, you have 
to import it as an OOo Draw document and print that office document;
AFAIK there is now away to then the PNG image directly to the printer
- and this is not wrong, OOo is an office suite, not a printing 

On the other hand, looking at the code in
you are able to draw onto a virtual device and print it. See the
attached code, it is Java version of this C++ sample.

Unfortunately this does not work, there is a bug in the implementation:
if ( mpListener.get() ) always evaluates to false, that shared pointer
has never been set before. For what I could understand there, it should

if ( mpPrinter.get() )
    maInitJobSetup = mpPrinter->GetJobSetup();
    mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) );

this seems to "work"... well, the "Print" dialog shows up now, with the
text drawn onto the virtual device:

funny indeed.

In short, print office documents, using the well known interfaces
described in the view module

Ariel Constenla-Haile
La Plata, Argentina

View raw message