// winppi.h
BOOL GdiEndPageEMF(
HANDLE SpoolFileHandle,
DWORD dwOptimization
);
View the official Windows Driver Kit DDI referenceNo description available.
The GdiEndPageEMF function ends EMF playback operations for a physical page of an EMF-formatted print job.
SpoolFileHandleCaller-supplied spool file handle, obtained by a previous call to GdiGetSpoolFileHandle.
dwOptimizationCaller-supplied flags. The following flag is defined:
Enable color optimization. For more information, see Remarks.
If the operation succeeds, the function returns TRUE. Otherwise the function returns FALSE, and an error code can be obtained by calling GetLastError.
The GdiEndPageEMF function is exported by gdi32.dll for use within a print processor's PrintDocumentOnPrintProcessor function.
The GdiEndPageEMF function ends the processing of a physical page and causes it to be ejected from the printer. A print processor should call GdiEndPageEMF at the following times:
If this function is called with the dwOptimization parameter set to EMF_PP_COLOR_OPTIMIZATION, color optimization is enabled. If dwOptimization is set to 0, no optimization is performed. When color optimization is enabled, the presence of color in the spool file causes the spool file to be played in color; the lack of color in the spool file causes the spool file to be played in monochrome.
If you are creating a Unidrv rendering plug-in to generate color watermarks, be advised that color optimization causes color watermarks to be printed in black and white when they are printed on black-and-white documents. To ensure that color watermarks print correctly with color and black-and-white documents, disable color optimization.
The color optimization controlled by the dwOptimization parameter can also be controlled by setting the dwColorOptimization member of the ATTRIBUTE_INFO_2 or ATTRIBUTE_INFO_3 structures. This optimization also can be controlled by the Unidrv *ChangeColorModeOnDoc? color attribute (see Color Attributes).
For additional information, see Using GDI Functions in Print Processors.