Creation

An empty display list can be created by the fz_new_display_list call.


\begin{lstlisting}
/*
fz_new_display_list: Create an empty display list.
\par
A...
...*fz_new_display_list(fz_context *ctx, const fz_rect *mediabox);
\end{lstlisting}

Once created it can be populated by creating a display list device instance that writes to it.


\begin{lstlisting}
/*
fz_new_list_device: Create a rendering device for a displ...
...ce *fz_new_list_device(fz_context *ctx, fz_display_list *list);
\end{lstlisting}

Once you have created such a display list device, any calls made to that device (such as by calling fz_run_page or similar) will be recorded into the display list.

When you have finished writing to the display list (remembering to call fz_close_device), you dispose of the device as normal (by calling fz_drop_device). This leaves you holding the sole reference to the display list itself.

Writing to a display list is not thread safe. That is to say, do not attempt to write to a display list from more than one thread at a time. Similarly, do not attempt to read from display lists while write operations are ongoing.