pdfAddPrintOverlayText
Add a printing overlay text item.
void pdfAddPrintOverlayText(PDFViewerHandle viewer, char *text,
char *gdiFontName, int gdiBold, int gdiItalic,
char *psFontName, COLORREF color, int size,
double x, double y, int angle, int flags)
This function adds a text overlay item to printed output. There can
be multiple overlays, and they will all be printed on each page.
The arguments are:
text
: the content of the overlay, i.e., the text to be printedgdiFontName
: font name for GDI (non-PostScript) printinggdiBold
: bold flag for GDI printing (1 means bold, 0 means regular)gdiItalic
: italic flag for GDI printing (1 means italic, 0 means plain)psFontName
: font name for PostScript printingcolor
: the text colorsize
: the font size, in pointsx, y
: the text position, measured in points from the lower-left corner of the pageangle
: the rotation angle, which can be 0, 90, 180, or 270 degreesflags
: optional flags - there is currently one flag available:pdfPrintOverlayUnder
: draw the overlay text first so that it appears "under" other drawn objects on the page (a so-called watermark); the exact behavior will depend on the nature of the PDF file, for example, a PDF file that starts by drawing a large, white, filled rectangle over the entire page will cover up any overlays drawn with this flag
flags
argument to zero to indicate no flags.
gdiFontName
, gdiBold
,
and gdiItalic
arguments will be used. When printing to a
PostScript printer, the psFontName
argument will be used.
Some common fonts are:
gdiFontName |
gdiBold |
gdiItalic |
psFontName |
---|---|---|---|
"Times New Roman" |
0 |
0 |
"Times-Roman" |
"Times New Roman" |
0 |
1 |
"Times-Italic" |
"Times New Roman" |
1 |
0 |
"Times-Bold" |
"Times New Roman" |
1 |
1 |
"Times-BoldItalic" |
"Arial" |
0 |
0 |
"Helvetica" |
"Arial" |
0 |
1 |
"Helvetica-Oblique" |
"Arial" |
1 |
0 |
"Helvetica-Bold" |
"Arial" |
1 |
1 |
"Helvetica-BoldOblique" |
"Courier New" |
0 |
0 |
"Courier" |
"Courier New" |
0 |
1 |
"Courier-Oblique" |
"Courier New" |
1 |
0 |
"Courier-Bold" |
"Courier New" |
1 |
1 |
"Courier-BoldOblique" |
You can add any number of text overlays: just call the
pdfAddPrintOverlayText
function multiple times (before
calling pdfPrint
or any of the other printing functions).
To clear all of the current overlays (e.g., before printing a
different set of pages from the document), use the
pdfClearPrintOverlayText
function.
C:
pdfAddPrintOverlayText(viewer, "CONFIDENTIAL",
"Arial", 1, 0, "Helvetica-Bold",
RGB(0, 0, 0), 10, 200, 50, 0, 0);