Package: cairo

Macro cairo:with-pdf-surface

Lambda List

cairo:with-pdf-surface ((surface path width height) &body body)

Syntax

(cairo:with-pdf-surface (surface path width height) body) => result

Arguments

surface -- a PDF cairo:surface-t instance
path -- a pathname or namestring with a path for the PDF output, nil may be used to specify no output, this will generate a PDF surface that may be queried and used as a source, without generating a temporary file
width -- a number coerced to a double float for the width of the surface, in points (1 point equals 1/72 inch)
height -- a number coerced to a double float for the height of the surface, in points (1 point equals 1/72 inch)

Details

The cairo:with-pdf-surface macro allocates a new PDF cairo:surface-t instance for the given path, width, and height values and executes the body that uses the PDF surface. After execution of the body the allocated memory for the PDF surface is released.

Notes

The PDF surface is created with the cairo:pdf-surface-create function and released with the cairo:surface-destroy function.
 

See also

2025-09-19