Haiku API Bindings
PrintJob
Not logged in

Documentation | InterfaceKit | PrintJob

SYNOPSIS

Perl

use HaikuR1::PrintJob;

my $job = HaikuR1::PrintJob->new($name);
$job->ConfigPage();
$job->ConfigJob();
$job->BeginJob();
$job->DrawView($view, $rect, $where);
$job->SpoolPage();
# more pages
$job->CommitJob();

Python

from HaikuR1.InterfaceKit import PrintJob

job = PrintJob.new(name)
job.ConfigPage()
job.ConfigJob()
job.BeginJob()
job.DrawView(view, rect, where)
job.SpoolPage()
# more pages
job.CommitJob()

DESCRIPTION

Exposes the BPrintJob object.

For more information on PrintJob, see the Be Book class description and the Be Book overview.

METHODS

Constructor

Creates a PrintJob.

Perl

HaikuR1::PrintJob->new($name);

Python

PrintJob(name)

Drawing

DrawView

SpoolPage

PaperRect

PrintableRect

DrawView is called to draw a View to the current page. (You can draw multiple Views to the same page.)

SpoolPage spools the current page; subsequent calls to DrawView will draw on the next page.

PaperRect and PrintableRect return Rect objects.

Perl

$printjob->DrawView($view, $rect, $where);
$printjob->SpoolPage();
$printjob->PaperRect();
$printjob->PrintableRect();

Python

printjob.DrawView(view, rect, where)
printjob.SpoolPage()
printjob.PaperRect()
printjob.PrintableRect()

GetResolution

Returns two elements, the horizontal and vertical dpi.

Perl

$printjob->GetResolution();

Python

printjob.GetResolution()

Job control

BeginJob

CommitJob

CancelJob

CanContinue

BeginJob starts a print job, and CommitJob sends it to the printer.

CancelJob cancels the job.

CanContinue will return true as long as the job is still valid.

Perl

$printjob->BeginJob();
$printjob->CommitJob();
$printjob->CancelJob();
$printjob->CanContinue();

Python

printjob.BeginJob()
printjob.CommitJob()
printjob.CancelJob()
printjob.CanContinue()

Page range

FirstPage

LastPage

Get the first and last page; can be called after ConfigJob.

Note that if the user selects all pages, the FirstPage will be 1 and the last page will be 2147483647.

Perl

$printjob->FirstPage();
$printjob->LastPage();

Python

printjob.FirstPage()
printjob.LastPage()

PrinterType

Returns one of the printer type constants.

Perl

$printjob->PrinterType();

Python

printjob.PrinterType()

Settings

SetSettings

IsSettingsMessageValid

ConfigPage

ConfigJob

These methods configure the page and job settings.

ConfigPage and ConfigJob will display configuration dialogs to the user.

The other methods allow you to save and load settings between sessions.

Perl

$printjob->Settings();
$printjob->SetSettings($archive);
$printjob->IsSettingsMessageValid($archive);
$printjob->ConfigPage();
$printjob->ConfigJob();

Python

printjob.Settings()
printjob.SetSettings(archive)
printjob.IsSettingsMessageValid(archive)
printjob.ConfigPage()
printjob.ConfigJob()

CONSTANTS

Printer type

Perl

use HaikuR1::PrintJob qw(:printer_type)

Python

Python does not support export tags.