private static SignConfigurationPdfRequestDetails BuildSignConfigurationRequest(AppConfiguration configuration) { var pdfPrivilege = new PdfPrivilegeModel( copyAllowLevel: 1, changeAllowLevel: 1, allowAssembly: true, allowScreenReaders: true, allowFillIn: true, allowModifyAnnotations: true, allowCopy: true, allowModifyContents: true, allowDegradedPrinting: true, allowPrint: true, printAllowLevel: 1, allowAll: true, forbidAll: false); return(new SignConfigurationPdfRequestDetails( signConfigurationId: Guid.Empty, name: "TestSignConfiguration", ownerPassword: "******", certificateId: configuration.CertificateDetails.CertificateId, subscriptionId: Guid.Empty, pdfPrivilege: pdfPrivilege )); }
/// <summary> /// Initializes a new instance of the <see cref="SignConfigurationPdfRequestDetails"/> class. /// </summary> /// <param name="signConfigurationId">Sign configuration Id.</param> /// <param name="name">Name of the configuration.</param> /// <param name="ownerPassword">Owner password.</param> /// <param name="certificateId">Certificate Id.</param> /// <param name="subscriptionId">Subscription Id.</param> /// <param name="pdfPrivilege">Pdf privileges.</param> public SignConfigurationPdfRequestDetails( Guid signConfigurationId, string name, string ownerPassword, Guid?certificateId, Guid subscriptionId, PdfPrivilegeModel pdfPrivilege) { this.SignConfigurationId = signConfigurationId; this.Name = name; this.OwnerPassword = ownerPassword; this.CertificateId = certificateId; this.SubscriptionId = subscriptionId; this.PdfPrivilege = pdfPrivilege; }
private static DocumentPrivilege FillPrivileges(PdfPrivilegeModel pdfPrivilege) { var privileges = DocumentPrivilege.ForbidAll; privileges.CopyAllowLevel = pdfPrivilege.CopyAllowLevel.Value; privileges.ChangeAllowLevel = pdfPrivilege.ChangeAllowLevel.Value; privileges.AllowAssembly = pdfPrivilege.AllowAssembly.Value; privileges.AllowScreenReaders = pdfPrivilege.AllowScreenReaders.Value; privileges.AllowFillIn = pdfPrivilege.AllowFillIn.Value; privileges.AllowModifyAnnotations = pdfPrivilege.AllowModifyAnnotations.Value; privileges.AllowCopy = pdfPrivilege.AllowCopy.Value; privileges.AllowModifyContents = pdfPrivilege.AllowModifyContents.Value; privileges.AllowDegradedPrinting = pdfPrivilege.AllowDegradedPrinting.Value; privileges.AllowPrint = pdfPrivilege.AllowPrint.Value; privileges.PrintAllowLevel = pdfPrivilege.PrintAllowLevel.Value; return(privileges); }