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

with-document-pages Macro

Summary

Executes a body of code repeatedly with a variable bound to the number of the page to be printed each iteration.

Package

capi

Signature

with-document-pages page-var first-page last-page &body body

Arguments
page-var
A symbol (not evaluated).
first-page
A positive integer.
last-page
A positive integer.
body
Lisp forms.
Description

The macro with-document-pages evaluates the forms in body repeatedly, with page-var bound to the number of the page to print on each iteration. It is used to by applications providing Page on Demand printing.

first-page and last-page are evaluated to yield the page numbers of the first and last pages in the document.

with-document-pages takes care of first-page and last-page when the user sets them in print-dialog, by evaluating body for the pages that are in the intersection of what user chose and the other arguments.

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

Notes

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.

Examples
(example-edit-file "capi/printing/fit-to-page")
(example-edit-file "capi/printing/multi-page")
(example-edit-file "capi/printing/page-on-demand")
See also

print-dialog
with-page
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