8.7 Color Considerations

Some formats, notably PDF, contain significant extra information to enable a high quality color managed workflow. The document interface (and the related page interface) have some methods to enable this.

Documents can have a defined ‘output intent’ that governs the color space (and profile) used for rendered output:

/* 
   Find the output intent colorspace if the document has defined one. 
*/ 
fz_colorspace *fz_document_output_intent(fz_context *ctx, fz_document *doc);

Callers will typically interrogate this before creating their output pixmaps if they want to honour it.

Each page in PDF can be authored with specific spot colors (inks) in mind. Details of these can be obtained from:

/* 
   fz_page_separations: Get the separations details for a page. 
   This will be NULL, unless the format specifically supports 
   separations (such as gproof, or PDF files). May be NULL even 
   so, if there are no separations on a page. 
 
   Returns a reference that must be dropped. 
*/ 
fz_separations *fz_page_separations(fz_context *ctx, fz_page *page);

The returned object will be NULL for all document formats that do not support spot colors (at the time of writing, all but PDF). For PDF, the object will be NULL for all pages that do not make use of separations.

More information about using these objects can be found in subsubsection 9.5.2 Advanced Rendering - Overprint and Spots.