PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllCreates a watermark in a PDF document.
|
| LONG CreateWaterMark () |
Return value
New watermark index.
Remarks
The method creates a new watermark in a PDF document. The return value is an watermark identifier in document's watermarks collection and can be used in CurrentWaterMarkIndex, PDFPAGE_DrawWatermark, PDFPAGE_Watermark.
When you use Watermark functions, you must set the watermark to the page BEFORE all other output functions.
Example
How to insert an image and show it as a watermark in PDF
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
j := PDF.CreateWatermark;
PDF.SwitchedToWaterMark := true;
PDF.PDFPAGE_Width := 376;
PDF.PDFPAGE_Height := 373;
PDF.PDFPAGE_PlayMetaFileFromFileName('autumnleaves.emf');
PDF.SwitchedToWaterMark := false;
PDF.PDFPAGE_Width := 376;
PDF.PDFPAGE_Height := 373;
PDF.PDFPAGE_WaterMark := j;
PDF.NewPage;
PDF.PDFPAGE_Width := 376;
PDF.PDFPAGE_Height := 373;
PDF.PDFPAGE_WaterMark := j;
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
LONG j = PDF->CreateWatermark();
PDF->SwitchedToWaterMark = TRUE;
PDF->PDFPAGE_Width = 376;
PDF->PDFPAGE_Height = 373;
PDF->PDFPAGE_PlayMetaFileFromFileName("autumnleaves.emf");
PDF->SwitchedToWaterMark = FALSE;
PDF->PDFPAGE_Width = 376;
PDF->PDFPAGE_Height = 373;
PDF->PDFPAGE_WaterMark = j;
PDF->NewPage();
PDF->PDFPAGE_Width = 376;
PDF->PDFPAGE_Height = 373;
PDF->PDFPAGE_WaterMark = j;
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
long j = PDF.CreateWatermark();
PDF.SwitchedToWaterMark = true;
PDF.PDFPAGE_Width = 376;
PDF.PDFPAGE_Height = 373;
PDF.PDFPAGE_PlayMetaFileFromFileName("autumnleaves.emf");
PDF.SwitchedToWaterMark = false;
PDF.PDFPAGE_Width = 376;
PDF.PDFPAGE_Height = 373;
PDF.PDFPAGE_WaterMark = j;
PDF.NewPage();
PDF.PDFPAGE_Width = 376;
PDF.PDFPAGE_Height = 373;
PDF.PDFPAGE_WaterMark = j;
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created PDF.BeginDoc j = PDF.CreateWatermark PDF.SwitchedToWaterMark = True PDF.PDFPAGE_Width = 376 PDF.PDFPAGE_Height = 373 PDF.PDFPAGE_PlayMetaFileFromFileName "autumnleaves.emf" PDF.SwitchedToWaterMark = False PDF.PDFPAGE_Width = 376 PDF.PDFPAGE_Height = 373 PDF.PDFPAGE_WaterMark = j PDF.NewPage PDF.PDFPAGE_Width = 376 PDF.PDFPAGE_Height = 373 PDF.PDFPAGE_WaterMark = j PDF.EndDoc
See Also


