Watermark & RTF
http://blogs.msdn.com/b/openspecification/archive/2013/02/04/rich-text-format-rtf-and-watermarks.aspx
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I'm beginning to look at how to do this, but it'll take implementing Shape first. And then I don't know if PHPWord is built do to text watermarks? Watermark seems to be something built into Image. Header's watermark builder only takes an Image file. So I'll have to look into that too, because I mostly use watermarks to add text.
I'm just saying, this is a much bigger request than I thought it would be on the surface. I thought RTF would simply have a watermark tag, but nope!
Here's what Microsoft Word output for an RTF watermark for the word "CONFIDENTIAL". I'm not yet sure what in that code is important or not.
I haven't tested making an image watermark, but still, this feels like a big project.
{\headerl \ltrpar \pard\plain \ltrpar\s35\ql \li0\ri0\widctlpar\tqc\tx4680\tqr\tx9360\wrapdefault
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid1784221 \par }
}
{\headerr \ltrpar \pard\plain \ltrpar\s35\ql \li0\ri0\widctlpar\tqc\tx4680\tqr\tx9360\wrapdefault
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1784221
{\shp
{\*\shpinst\shpleft0\shptop0\shpright10557\shpbottom2639\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz0\shplid1025
{\sp{\sn shapeType}{\sv 136}}
{\sp{\sn fFlipH}{\sv 0}}
{\sp{\sn fFlipV}{\sv 0}}
{\sp{\sn rotation}{\sv 20643840}}
{\sp{\sn gtextUNICODE}{\sv CONFIDENTIAL}}
{\sp{\sn gtextSize}{\sv 65536}}
{\sp{\sn gtextFont}{\sv Calibri}}
{\sp{\sn fGtext}{\sv 1}}
{\sp{\sn gtextFStretch}{\sv 1}}
{\sp{\sn fillColor}{\sv 12632256}}
{\sp{\sn fillOpacity}{\sv 32768}}
{\sp{\sn fLine}{\sv 0}}
{\sp{\sn wzName}{\sv PowerPlusWaterMarkObject357476642}}
{\sp{\sn posh}{\sv 2}}
{\sp{\sn posrelh}{\sv 0}}
{\sp{\sn posv}{\sv 2}}
{\sp{\sn posrelv}{\sv 0}}
{\sp{\sn dhgt}{\sv 251659264}}
{\sp{\sn fLayoutInCell}{\sv 0}}
{\sp{\sn fBehindDocument}{\sv 1}}
{\sp{\sn fLayoutInCell}{\sv 0}}
}
{\shprslt\par\pard\ql \li0\ri0\widctlpar\phmrg\posxc\posyc\dxfrtext180\dfrmtxtx180\dfrmtxty0\wraparound\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \par}
}
}
}