MeVisLab Scripting Reference
MLABPrinter Class Reference

#include <mlabScriptWrappers.h>

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.setOutputFileName(filename)
p.printHtml(html)
void setOutputFormat(const QString &format)
Sets the output format (may be "PDF" or "NATIVE").
Access to all global functions and objects of MLAB.
Definition mlabGlobalScriptAccess.h:79
MLABPrinter * newPrinter()
Creates a new process, see MLABPrinter class for its API.
void deletePrinter(MLABPrinter *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.