internal static PdfPanel CreateFromXElement(XElement element) { XNamespace xmlns = element.Name.Namespace; PdfPanel panel = new PdfPanel(); panel.Style.PopulateFromXElement(element); if (element.Elements().Any()) { panel.Content.AddRange(element.Elements().Select(e => PdfElementFactory.CreateFromXElement(e))); } return panel; }
public override iTextSharp.text.IElement GeneratePdfElement() { SignaturePanelStyle style = (Manifest != null) ? Manifest.Styles.GetMergedFromConfiguration(Style) : Style; Phrase phrase = new Phrase(); Chunk signature = new Chunk(Signature); signature.Style.Font.Apply(style.Font); phrase.Content.Add(signature); phrase.Content.Add(new NewLine()); Separator separator = new Separator(); separator.Style.BorderColor = style.BorderColor; separator.Style.Width = style.BorderWidth; phrase.Content.Add(separator); GenericIdentity identity = new GenericIdentity(User); AD.ActiveDirectory activeDirectory = new AD.ActiveDirectory(); UserDescriptor adUser = activeDirectory.GetUser(identity.GetUserName()); string fullName = adUser.DisplayName; phrase.Content.Add(new NewLine()); phrase.Content.Add(new Chunk(String.Format("{0} ({1:MMMM dd, yyyy})", fullName, Date))); PdfPanel panel = new PdfPanel(phrase); panel.Style.BackgroundColor = style.BackgroundColor; panel.Style.BorderColor = style.BorderColor; panel.Style.Padding = style.Padding; panel.Style.BorderWidth = style.BorderWidth; panel.Style.Width = style.Width; return panel.GeneratePdfElement(); }