public void SetClippingMask(float width, float height, float x, float y) { template = topTemplate.CreateTemplate(width, height); topTemplate.AddTemplate(template, x, topTemplate.Height - height - y); currentWidth = width; currentHeight = height; }
static void AddWatermake(Document doc, PdfWriter _write, Image img, string txt) { float _w = doc.Right - doc.Left; float _h = doc.Top - doc.Bottom; PdfTemplate template = PdfTemplate.CreateTemplate(_write, _w, _h); img.GrayFill = 100; img.SetAbsolutePosition(_w / 2 - (img.Width / 2), _h / 2 - (img.Height / 2)); template.AddImage(img, img.Width, 0, 0, img.Height, 0, 0); //ColumnText.ShowTextAligned(template, Element.ALIGN_CENTER, GetPhrase(txt, PDFFONTFAMILY.宋体, 12), _w / 2, _h / 2, 30); doc.Add(Image.GetInstance(template)); }