Graft maps

A pdf_graft_map is a mapping from one pdf_document to another that ensures objects in the source document are only ever copied into the target document at most once.


\begin{lstlisting}
/*
pdf_new_graft_map: Prepare a graft map object to allow ob...
...pped_object(fz_context *ctx, pdf_graft_map *map, pdf_obj *obj);
\end{lstlisting}

A `safe' version of the example given earlier that copies both Root/Example and Root/Example2 would therefore be:


\begin{lstlisting}
pdf_graft_map *map = pdf_new_graft_map(ctx, docB);
\par
pdf_d...
...ctx, docA,
''Root/Example2''));
pdf_drop_graft_map(ctx, map);
\end{lstlisting}