| Top Previous Next |
|
Marks the beginning of the watermark.
Syntax
Remarks
Watermarks are text or graphics that appear below the document content. They appear on all the pages of the document.
A watermark is defined between the BeginWatermark and EndWatermark. All the elements (text/graphics) that needs to appear as watermark (below the content) should be specified between the BeginWatermark and EndWatermark block. You may use watermark to indicate that a particular document is a draft copy by including a text element and setting its text to 'DRAFT'. The BeginWatermark and EndWatermark block needs to be coded only once for each document regardless of the number of pages it contains. You can code the block immediately after calling BeginDoc.
You can also change the watermark from a particular page of a document: just handle the OnBeforeBeginPage event and use the CurrentPage property for coding the new watermark at the required page. From that point of document, all pages will contain the new watermark.
Example Code
[VC++] m_Engine.SetFileName("Sample"); m_Engine.BeginDoc();
long state1 = m_Engine.SaveEngineState();
m_Engine.BeginWatermark();
// Get the font object. COleFont fnt = m_Engine.GetFont(); // Set the font name and styles. fnt.SetName("Arial"); fnt.SetBold(true); // Set the font size. CY fntSize = m_Engine.GetFont().GetSize(); fntSize.int64 = 500000; fnt.SetSize(fntSize);
m_Engine.GetTextEffects().SetTextRenderMode(trmStroke); m_Engine.TextOutXY(2.5, 4, "CONFIDENTIAL"); m_Engine.EndWatermark();
m_Engine.RestoreEngineState(state1); m_Engine.GetTextEffects().SetTextRenderMode(trmFill);
m_Engine.TextOutXY(1, 1, "This is page one");
m_Engine.NewPage(); m_Engine.TextOutXY(1, 1, "This is page two"); m_Engine.EndDoc();
[VB] With gtEngineX1 .FileName = "Sample" .BeginDoc
State1 = .SaveEngineState
.BeginWatermark .Font.Name = "Arial" .Font.Size = 50 .Font.Bold = True .TextEffects.TextRenderMode = trmStroke .TextOutXY 2.5, 4, "CONFIDENTIAL" .EndWatermark
.RestoreEngineState State1 .TextEffects.TextRenderMode = trmFill
.TextOut "This is page one"
.NewPage .TextOut "This is page two" .EndDoc End With
[C#] axgtEngineX1.FileName = "Sample"; axgtEngineX1.BeginDoc(); int State1 = axgtEngineX1.SaveEngineState(); axgtEngineX1.BeginWaterMark(); Font F; F = new Font("Arial" , 50,FontStyle.Bold ); axgtEngineX1.Font = F; axgtEngineX1.TextEffects.TextRenderMode = eDocEngineX.TxgtTextRenderMode.trmStroke; axgtEngineX1.TextOutXY( 2.5, 4, "CONFIDENTIAL" ); axgtEngineX1.EndWaterMark(); axgtEngineX1.RestoreEngineState( State1); axgtEngineX1.TextEffects.TextRenderMode = eDocEngineX.TxgtTextRenderMode.trmFill; axgtEngineX1.TextOut( "This is page one" ); axgtEngineX1.NewPage(); axgtEngineX1.TextOut( "This is page two" ); axgtEngineX1.EndDoc();
See Also
EndWatermark, BeginStamp, EndStamp
|