SwitchedToWatermark
IPDFDocument3 :: General document methods

See Also Example
Collapse All

This property gets or sets the watermark mode.

Syntax

VARIANT_BOOL SwitchedToWatermark { get; set; }
Value
VARIANT_TRUE if the watermark mode is switched on, VARIANT_FALSE otherwise.

Remarks

If SwitchedToWaterMark is set to VARIANT_TRUE, all PDFPAGE_* commands are applied to the watermark, created by the CreateWaterMark method. The index of the current watermark can be obtained by using CurrentWaterMarkIndex. When you use Watermark functions, you must set the watermark to the page BEFORE all other output functions.

Equivalent in new interface: IPDFDocument4::SwitchToWatermark, IPDFDocument4::SwitchToCurrentPage.

Example

How to Insert an Image and Show It as a Watermark

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

Reference