All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

with-page Macro

Summary

Binds a variable to either t or nil, and executes a body of code to print a page only if the variable is t.

Package

capi

Signature

with-page (printp) &body body

Arguments
printp
A symbol (not evaluated).
body
Lisp forms.
Description

The macro with-page binds printp to t if a page is to be printed, or nil if it is to be skipped. The forms in body are evaluated once as in implicit progn, and are expected to draw the document only if printp is t.

Each call to with-page contributes a new page to the document.

with-page must be called within the dynamic context of with-print-job.

Notes
  1. with-page does not work on Cocoa.
  2. The code in body should do the printing by calling standard GRAPHICS-PORTS drawing functions (see 13.4 Drawing functions), typically also using with-page-transform.
  3. printp can be nil when only part of the document is printed, for example when the user specifies that she wants only odd pages. When printp is nil, the code in body needs to ensure that the next call to with-page prints the right page.
  4. Normally with-document-pages is the preferred method of printing.
See also

with-document-pages
with-page-transform
with-print-job
16 Printing from the CAPI—the Hardcopy API


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42