- Main Page
- Packages
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.print.PrintDC Class Reference

The smjg.libs.sdwf.print.PrintDC class represents a device context for a printer. More...

Inheritance diagram for smjg.libs.sdwf.print.PrintDC:

List of all members.

## Public Member Functions
| this (PrintDialog dlg)
| Constructs a new PrintDC.
| this (PrintDialog dlg, string documentName)
| Constructs a new PrintDC and starts the print job.
| this ()
| Constructs a new PrintDC for the system default printer.
| this (string documentName)
| Constructs a new PrintDC for the system default printer, and starts the print job.
void | startDocument (string documentName, bool startPage=true)
| Starts the print job.
void | endDocument ()
| Ends the print job.
void | nextPage ()
| Advances to the next page.
| ~this ()
Properties
RectDim | pageSize ()
| Gets the dimensions of the whole page in device units.
Vector | printableOffset ()
| Gets the offset of device coordinate (0, 0) from the corner of the physical page.
bool | inDocument ()
| Whether a document is currently in progress.
bool | inPage ()
| Whether a page is currently in progress.
## Public Attributes
DOCINFOA | docInfo
| A Windows API structure containing information about the print job.
## Protected Attributes
bool | _inDocument = false
bool | _inPage = false

## Detailed Description

The smjg.libs.sdwf.print.PrintDC class represents a device context for a printer.

Since:
  0.4

## Constructor & Destructor Documentation

smjg.libs.sdwf.print.PrintDC.this | ( | PrintDialog | dlg | ) |

Constructs a new PrintDC.

Parameters:

  | dlg | the print dialog that created the DC.

Precondition:
  `dlg.show()` must have been called, and the resulting DC must be still owned by the PrintDialog object (i.e. not have already been used to construct a PrintDC).

Status:
  done

smjg.libs.sdwf.print.PrintDC.this | ( | PrintDialog | dlg,
|  | string | documentName |
| ) |  |  |

Constructs a new PrintDC and starts the print job.

Parameters:

  | dlg | the print dialog that created the DC.
  | documentName | name by which the document will be identified. This name appears when viewing the printer's queue.

Precondition:
  `dlg.show()` must have been called, and the resulting DC must be still owned by the PrintDialog object (i.e. not have already been used to construct a PrintDC).

Status:
  done

smjg.libs.sdwf.print.PrintDC.this | ( |  | ) |

Constructs a new PrintDC for the system default printer.

Status:
  done

smjg.libs.sdwf.print.PrintDC.this | ( | string | documentName | ) |

Constructs a new PrintDC for the system default printer, and starts the print job.

Parameters:

  | documentName | name by which the document will be identified. This name appears when viewing the printer's queue.

Status:
  done

smjg.libs.sdwf.print.PrintDC.~this | ( |  | ) |

## Member Function Documentation

void smjg.libs.sdwf.print.PrintDC.startDocument | ( | string | documentName,
|  | bool | startPage = `true` |
| ) |  |  |

Starts the print job.

Parameters:

  | documentName | name by which the document will be identified. This name appears when viewing the printer's queue.
  | startPage | whether the first page will automatically be started. If `false`, a call to PrintDC.nextPage is necessary before you start to print the first page. (Since 0.5)

Status:
  done

void smjg.libs.sdwf.print.PrintDC.endDocument | ( |  | ) |

Ends the print job.

It is generally only necessary to call this method if you are using a single PrintDC instance to print multiple jobs.

Status:
  done

void smjg.libs.sdwf.print.PrintDC.nextPage | ( |  | ) |

Advances to the next page.

Status:
  done

RectDim smjg.libs.sdwf.print.PrintDC.pageSize | ( |  | ) | `[virtual]`

Gets the dimensions of the whole page in device units.

Status:
  done

Implements smjg.libs.sdwf.print.PrintDCBase.

Vector smjg.libs.sdwf.print.PrintDC.printableOffset | ( |  | ) | `[virtual]`

Gets the offset of device coordinate (0, 0) from the corner of the physical page.

This is the top-left corner of the printable area of the page.

Status:
  done

Implements smjg.libs.sdwf.print.PrintDCBase.

bool smjg.libs.sdwf.print.PrintDC.inDocument | ( |  | ) |

Whether a document is currently in progress.

bool smjg.libs.sdwf.print.PrintDC.inPage | ( |  | ) |

Whether a page is currently in progress.

## Member Data Documentation

DOCINFOA smjg.libs.sdwf.print.PrintDC.docInfo

Initial value:

     {
                          cbSize:      DOCINFOA.sizeof
                  }

A Windows API structure containing information about the print job.

bool smjg.libs.sdwf.print.PrintDC._inDocument = false`[protected]`

bool smjg.libs.sdwf.print.PrintDC._inPage = false`[protected]`

The documentation for this class was generated from the following file:

- print.d