mozilla

NPP_Print

« Gecko Plugin API Reference « Plug-in Side Plug-in API

Summary

Requests a platform-specific print operation for an embedded or full-screen plug-in.

Syntax

#include <npapi.h>
 
void NPP_Print(NPP instance, NPPrint* PrintInfo);

Parameters

The function has the following parameters:

instance
Pointer to the current plug-in instance. Must be embedded or full-screen.
printInfo
Pointer to NPPrint structure.

Description

NPP_Print is called when the user requests printing for a web page that contains a visible plug-in (either embedded or full-page). It uses the print mode set in the NPPrint structure in its printInfo parameter to determine whether the plug-in should print as an embedded plug-in or as a full-page plug-in.

  • An embedded plug-in shares printing with the browser; the plug-in prints the part of the page it occupies, and the browser handles everything else, including displaying print dialog boxes, getting the printer device context, and any other tasks involved in printing, as well as printing the rest of the page. For an embedded plug-in, set the printInfo field to NPEmbedPrint.
  • A full-page plug-in handles all aspects of printing itself. For a full-page plug-in, set the printInfo field to NPFullPrint or null.

For information about printing on your platform, see your platform documentation.

MS Windows

On MS Windows printInfo->print.embedPrint.platformPrint is the device context (DC) handle. Be sure to cast this to type HDC.

The coordinates for the window rectangle are in TWIPS format. This means that you need to convert the x-y coordinates using the Windows API call DPtoLP when you output text.

See Also

NPPrint, NPFullPrint, NPEmbedPrint

Document Tags and Contributors

Tags: 
Contributors to this page: teoli, Mgjbot, Pmash
Last updated by: Mgjbot,
Hide Sidebar