I'm using AddTextWatermark to add a single Watermarktext on all pdf-pages with the following steps:
- Create Printer
- Call AddTextWatermark(...) with Text 1 (same sName-Parameter)
- Print Doc
- call AddTextWatermark(...) with Text 2 ( same sName-Parameter)
- Print Doc
- ...
- Destroy Printer
The first Parameter 'sName' is always the same.
The result is Doc1 has Text 1, Doc2 has Text 1 + Text 2, Doc3 would have Text 1 + Text 2 + Text 3 and son on.
From the documenation "If there is already a watermark with the same name - it will be overwritten!".
That does not seem to work?
Perhaps there is a way to remove a specific watermark or simple all?
The Code to set the Watermarktext:
Code: Select all
HRESULT hr = m_Printer->AddTextWatermark
(
L"DB",
strWatermarkText.AllocSysString(),
L"Arial",
400, //[in] long dwFontWeight,
0, //[in] long bItalic,
0, //[in] long bOutline,
45, //[in] long nFontSize,
0, //[in] long nLineWidth,
1, //[in] long nTextcolor,
1+16, //[in] long dwAlign,
0, //[in] long xOffset,
0, //[in] long yOffset,
45, //[in] long nAngle,
25, //[in] long dwOpacity,
2+4+8+16, //[in] long dwFlags,
0, //[in] long dwPlaceType,
L"1-" //[in] BSTR sRange);
);
m_Printer->Option[L"Watermarks.Enabled"] = "Yes";
m_Printer->Option[L"Watermarks.Watermarks"] = "DB";
m_Printer->ApplyOptions(0);
Edit: My current solution is a call from m_Printer->ResetDefaults(); before m_Printer->AddTextWatermark
Thanks
Peter