PDFPAGE_DrawWatermark
IPDFDocument3 :: PDF page methods

See Also
Collapse All

This method draws an existing watermark on the current PDF page.

Syntax

HRESULT PDFPAGE_DrawWatermark (
LONG watermarkIndex
)
Parameters
watermarkIndex
Index of an existing watermark

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

This method draws the watermark created using the CreateWatermark method. You can create a watermark (a logo, for example) and use it on any page, in page headers and footers, etc. Since the watermark body is used only once in a PDF, the document will be small, even if you use the watermark many times. If you want to put a watermark at a specific position on the page, you should create the watermark, setup its dimensions using PDFPAGE_Width and PDFPAGE_Height, and place it on the page using PDFPAGE_DrawWatermark. The watermark will be positioned relative to the bottom left corner of the page.

For example, if you want to put your content at the top and bottom of each page, you can create a watermark with dimensions the same as the PDF page and then output any contents at the desired positions. If you're using other dimensions for the watermark, remember to take into account that watermarks are positioned relative to the bottom left corner of the PDF page.

Equivalent in new interface: IPDFDocument4::AttachWatermark.

See Also

Reference