Added handler for !atom pagelist token
Added code to deal with draftpage, samplepage, masterpage and referencepage tokens Added code to limit allowed watermarks
This commit is contained in:
@@ -430,6 +430,10 @@ namespace Volian.Svg.Library
|
||||
if (Width.Value != 0)
|
||||
img.ScaleAbsoluteWidth(scale.M(Width));
|
||||
img.SetAbsolutePosition(scale.X(X), scale.Y(cb, Y) - scale.M(img.ScaledHeight));
|
||||
// The next three lines set the image opacity for testing
|
||||
//PdfGState gState = new PdfGState();
|
||||
//gState.FillOpacity = .2f;
|
||||
//cb.SetGState(gState);
|
||||
cb.AddImage(img);
|
||||
cb.RestoreState();
|
||||
}
|
||||
@@ -790,6 +794,12 @@ namespace Volian.Svg.Library
|
||||
}
|
||||
public class SvgPageHelper : PdfPageEventHelper
|
||||
{
|
||||
private List<string> _AllowedWatermarks = new List<string>();
|
||||
public List<string> AllowedWatermarks
|
||||
{
|
||||
get { return _AllowedWatermarks; }
|
||||
set { _AllowedWatermarks = value; }
|
||||
}
|
||||
private Svg _MySvg;
|
||||
public Svg MySvg
|
||||
{
|
||||
@@ -947,6 +957,7 @@ namespace Volian.Svg.Library
|
||||
private void DrawWatermark(PdfContentByte cb)
|
||||
{
|
||||
if (Watermark.ToLower().Contains("none") || Watermark == "") return;
|
||||
if (!AllowedWatermarks.Contains(Watermark)) return;
|
||||
cb.SaveState();
|
||||
if (_WatermarkLayer != null) cb.BeginLayer(_WatermarkLayer);
|
||||
SvgWatermark myWatermark = new SvgWatermark(cb, Watermark, System.Drawing.Color.Blue, .15F);
|
||||
|
Reference in New Issue
Block a user