Miscellaneous operations

There are a few other operations that can be performed efficiently on a display list. Firstly, one can request the bounds of a list.


\begin{lstlisting}
/*
fz_bound_display_list: Return the bounding box of the pag...
..._list(fz_context *ctx, fz_display_list *list, fz_rect *bounds);
\end{lstlisting}

Note that this is the bounding box of the page that was written to the display list, not the bounding box of the contents of the list; the latter will typically (but not always) be smaller than the former due to page borders etc.

Secondly, one can create a new fz_image from a display list. This is useful for creating scalable content to embed in other document types; for instance MuPDF makes use of this to turn SVG files embedded within EPUB files (for illustrations and cover pages etc) into convenient objects for adding into the flow of text.


\begin{lstlisting}
/*
Create a new image from a display list.
\par
w, h: The co...
...list(fz_context *ctx, float w, float h, fz_display_list *list);
\end{lstlisting}

Finally, it is possible to very quickly check if a given display list is empty or not.


\begin{lstlisting}
/*
Check for a display list being empty
\par
list: The list ...
...ay_list_is_empty(fz_context *ctx, const fz_display_list *list);
\end{lstlisting}