21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The StarDesktop 83<br />

Printing Documents<br />

Similar to saving, documents are printed out directly by means of the document object. The<br />

Print method of the<br />

com.sun.star.view.Xprintable<br />

interface is provided for this purpose. In its simplest form, the print call is:<br />

Dim Dummy()<br />

Doc.print(Dummy())<br />

As in the case of the loadComponentFromURL method, the Dummy parameter is a<br />

PropertyValue data field through which <strong>OpenOffice</strong>.<strong>org</strong> can specify several options for<br />

printing.<br />

The options of the print method<br />

The print method expects a PropertyValue data field as a parameter, which reflects the<br />

settings of the print dialog of <strong>OpenOffice</strong>.<strong>org</strong>:<br />

CopyCount (Integer)<br />

specifies the number of copies to be printed.<br />

FileName (String)<br />

prints the document in the specified file.<br />

Collate (Boolean)<br />

advises the printer to collate the pages of the copies.<br />

Sort (Boolean)<br />

sorts the pages when printing out several copies (CopyCount > 1).<br />

Pages (String)<br />

contains the list of the pages to be printed (syntax as specified in print dialog).<br />

The following example shows how several pages of a document can be printed out using the<br />

Pages option:<br />

Dim Doc As Object<br />

Dim PrintProperties(0) As New com.sun.star.beans.PropertyValue<br />

PrintProperties(0).Name="Pages"<br />

PrintProperties(0).Value="1-3; 7; 9"<br />

Doc.print(PrintProperties())

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!