addOverlayText
Add an overlay text item.
addOverlayText([in] BSTR text, [in] BSTR gdiFontName,
[in] VARIANT_BOOL gdiBold, [in] VARIANT_BOOL gdiItalic,
[in] BSTR psFontName, [in] OLE_COLOR color, [in] int size,
[in] double x, [in] double y, [in] int angle, [in] LONG flags)
This function adds a text overlay item. 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:overlayUnder
: 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" |
false |
false |
"Times-Roman" |
"Times New Roman" |
false |
true |
"Times-Italic" |
"Times New Roman" |
true |
false |
"Times-Bold" |
"Times New Roman" |
true |
true |
"Times-BoldItalic" |
"Arial" |
false |
false |
"Helvetica" |
"Arial" |
false |
true |
"Helvetica-Oblique" |
"Arial" |
true |
false |
"Helvetica-Bold" |
"Arial" |
true |
true |
"Helvetica-BoldOblique" |
"Courier New" |
false |
false |
"Courier" |
"Courier New" |
false |
true |
"Courier-Oblique" |
"Courier New" |
true |
false |
"Courier-Bold" |
"Courier New" |
true |
true |
"Courier-BoldOblique" |
You can add any number of text overlays: just call the
addOverlayText
function multiple times (before calling
printPDF4
).
To clear all of the current overlays (e.g., before printing a
different set of pages from the document), use the
clearOverlayText
function.
VB:
pdf.addOverlayText("CONFIDENTIAL", "Arial", 1, 0, "Helvetica-Bold", _
RGB(0, 0, 0), 10, 200, 50, 0, 0)