MeVisLab Scripting Reference
MLABPrinter Class Reference

Inherits QObject.

Public Slots

Script access


void setOutputFormat (const QString &format)
 
void setOutputFileName (const QString &filename)
 
void setLandscapeOrientation ()
 
void setPortraitOrientation ()
 
void setPageSize (const QString &paperSize)
 
void printTextDocument (QTextDocument *document)
 
void printHtml (const QString &html, const QString &localPath=QString())
 
bool showPrintDialog ()
 

Detailed Description

MLABPrinter object available via MLAB.

The MLABPrinter object can be used to print either to a printer or a PDF document:

html = "<b>test</b>"
p.setOutputFormat("PDF")
p.setOutputFileName(filename)
p.printHtml(html)
Access to all global functions and objects of MLAB.
Definition: mlabGlobalScriptAccess.h:81
MLABScriptPrinter * newPrinter()
Creates a new process, see MLABPrinter class for its API.
void deletePrinter(MLABScriptPrinter *process)
Deletes an MLABPrinter object.

See the TestPrinting module for getting a complete example.

Member Function Documentation

◆ printHtml

void MLABPrinter::printHtml ( const QString &  html,
const QString &  localPath = QString() 
)
slot

Prints the given rich text, localPath is used to resolve links to images.

◆ printTextDocument

void MLABPrinter::printTextDocument ( QTextDocument *  document)
slot

Prints the given text document.

◆ setLandscapeOrientation

void MLABPrinter::setLandscapeOrientation ( )
slot

Sets to landscape orientation.

◆ setOutputFileName

void MLABPrinter::setOutputFileName ( const QString &  filename)
slot

Sets the filename to be written.

◆ setOutputFormat

void MLABPrinter::setOutputFormat ( const QString &  format)
slot

Sets the output format (may be "PDF" or "NATIVE").

◆ setPageSize

void MLABPrinter::setPageSize ( const QString &  paperSize)
slot

Sets the page size.

◆ setPortraitOrientation

void MLABPrinter::setPortraitOrientation ( )
slot

Sets to portrait orientation.

◆ showPrintDialog

bool MLABPrinter::showPrintDialog ( )
slot

Configures with print dialog, returns true if printing should be performed.