public void SignStampPdf() { // Set request var testFile = TestFiles.PdfStorage.FirstOrDefault(); var fileInfo = testFile.GetFileInfo(); var signedFileName = $@"Output\PdfStampSigned.{testFile.Extension}"; var options = new SignStampOptions(); PopulateOptions(options); var signSettings = new SignSettings(); signSettings.FileInfo = fileInfo; signSettings.SaveOptions = new SaveOptions() { OutputFilePath = signedFileName }; signSettings.Options = new List <SignOptions>() { options }; var request = new CreateSignaturesRequest(signSettings); // Get and check result var response = SignatureApi.CreateSignatures(request); CheckResponse(response, testFile); //Download the signed file this.DownloadFile(signedFileName); }
public void SignCollectionPdf() { // Set request var testFile = TestFiles.PdfStorage.FirstOrDefault(); var fileInfo = testFile.GetFileInfo(); var signedFileName = $@"Output\PdfCollectionSigned.{testFile.Extension}"; var optionsBarcode = new SignBarcodeOptions(); TestsSignBarcode.PopulateOptions(optionsBarcode); optionsBarcode.Top = 0; var optionsQrCode = new SignQRCodeOptions(); TestsSignQrCode.PopulateOptions(optionsQrCode); optionsQrCode.Top = optionsBarcode.Height + 20; var optionsDigital = new SignDigitalOptions(); TestsSignDigital.PopulateOptions(optionsDigital); optionsDigital.Top = optionsQrCode.Top + optionsQrCode.Height + 20; var optionsText = new SignTextOptions(); TestsSignText.PopulateOptions(optionsText); optionsText.Top = optionsDigital.Top + optionsDigital.Height + 20; var optionsImage = new SignImageOptions(); TestsSignImage.PopulateOptions(optionsImage); optionsImage.Top = optionsText.Top + optionsText.Height + 20; var optionsStamp = new SignStampOptions(); TestsSignStamp.PopulateOptions(optionsStamp); optionsStamp.Top = optionsImage.Top + optionsImage.Height + 20; var signSettings = new SignSettings(); signSettings.FileInfo = fileInfo; signSettings.SaveOptions = new SaveOptions() { OutputFilePath = signedFileName }; signSettings.Options = new List <SignOptions>() { optionsBarcode, optionsQrCode, optionsDigital, optionsText, optionsImage, optionsStamp }; var request = new CreateSignaturesRequest(signSettings); // Get and check result var response = SignatureApi.CreateSignatures(request); CheckResponse(response, testFile); //Download the signed file this.DownloadFile(signedFileName); }