Mono

The monochrome version of the PWG writer parallels the contone one. It can accept monochrome bitmaps only.

PWG files can be saved to a file using:


\begin{lstlisting}
/*
fz_save_bitmap_as_pwg: Save a bitmap as a pwg
\par
filena...
...bitmap, 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 bitmap to an output stream as a pwg raster.
*/
v...
...tput *out, const fz_bitmap *bitmap, 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 bitmap page to a pwg stream to follow a header, ...
...tput *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg);
\end{lstlisting}

Finally, a standard band writer can be used:


\begin{lstlisting}
/*
fz_new_mono_pwg_band_writer: Generate a new band writer f...
...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.