Esempio n. 1
0
 public static void SetMetadata(YapsConfig config, PdfStamper stamper)
 {
     var meta = config.Metadata;
     if (meta == null || meta.Count <= 0) return;
     //st.MoreInfo = new Hashtable(meta);
     stamper.MoreInfo = meta;
     stamper.XmpMetadata = config.GetStreamedMetaData();
 }
Esempio n. 2
0
        public static void SetAppearance(YapsConfig config, PdfSignatureAppearance sap)
        {
            var appearance = config.Appearance ?? new SignatureAppearance();
            sap.Reason = appearance.Reason;
            sap.Contact = appearance.Contact;
            sap.Location = appearance.Location;
            sap.SignDate = DateTime.Now;
            sap.Acro6Layers = true;
            if (!config.Visible || !appearance.ValidateRect())
                return;

            //iTextSharp.text.Rectangle rect = st.Reader.GetPageSize(sigAP.Page);
            var xi = appearance.X + appearance.Width;
            var yi = appearance.Y + appearance.Height;
            var rect = new iTextSharp.text.Rectangle(appearance.X, appearance.Y, xi, yi);
            //sap.Image = sigAP.RawData == null ? null : iTextSharp.text.Image.GetInstance(sigAP.RawData);
            if (!string.IsNullOrEmpty(appearance.CustomText))
                sap.Layer2Text = appearance.CustomText;
            //sap.SetVisibleSignature(new iTextSharp.text.Rectangle(100, 100, 300, 200), 1, "Signature");
            sap.SetVisibleSignature(rect, appearance.Page, "Signature");
        }
Esempio n. 3
0
 public TokenSigner(YapsConfig config)
 {
     Config = config;
 }
Esempio n. 4
0
 public Controller(YapsConfig config)
 {
     this.config = config;
 }
Esempio n. 5
0
 public static IPdfSigner GetSigner(YapsConfig config)
 {
     if (!config.UseSmartcard)
         return new PdfSigner(config);
     return new TokenSigner(config);
 }
Esempio n. 6
0
 public PdfSigner(YapsConfig configuration)
 {
     config = configuration;
 }