Contone

The PWG writer can accept pixmaps in greyscale, RGB and CMYK format, with no alpha planes.

PWG files can be saved to a file using:


\begin{lstlisting}
/*
fz_save_pixmap_as_pwg: Save a pixmap as a pwg
\par
filena...
...pixmap, char *filename, int append, const fz_pwg_options *pwg);
\end{lstlisting}

The file header will only be sent in the case where we are not appending to an existing file.

Alternatively, pages may be sent to an output stream. Two functions exist to do this. The first always sends a complete PWG file (including header):


\begin{lstlisting}
/*
Output a pixmap to an output stream as a pwg raster.
*/
v...
...tput *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);
\end{lstlisting}

The second sends just the page data, and is therefore suitable for sending the second or subsequent pages in a file. Alternatively, the header can be sent manually, and then this function can be used for all the pages in a file.


\begin{lstlisting}
/*
Output a page to a pwg stream to follow a header, or othe...
...tput *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);
\end{lstlisting}

Finally, a standard band writer can be used:


\begin{lstlisting}
/*
fz_new_pwg_band_writer: Generate a new band writer for
c...
...er(fz_context *ctx, fz_output *out, const fz_pwg_options *pwg);
\end{lstlisting}

In all cases, a NULL value can be sent for the fz_pwg_options field, in which case default values will be used.