|
@@ -116,7 +116,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
tempSignatureConfig.IsDrawLogo = (bool)LogoChk.IsChecked;
|
|
|
if (tempSignatureConfig.IsDrawLogo)
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(logoPath))
|
|
|
+ if (!string.IsNullOrEmpty(logoPath))
|
|
|
{
|
|
|
byte[] imageData = null;
|
|
|
int imageWidth = 0;
|
|
@@ -139,7 +139,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
tempSignatureConfig.TextColor = textColor;
|
|
|
tempSignatureConfig.ContentColor = new float[] { 0, 0, 0 };
|
|
|
|
|
|
- if(DynamicAP.IsChecked==true)
|
|
|
+ if (DynamicAP.IsChecked == true)
|
|
|
{
|
|
|
tempSignatureWidget.UpdateSignApWithSignature(tempSignatureConfig);
|
|
|
}
|
|
@@ -294,7 +294,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
|
int height = 0;
|
|
|
int width = 0;
|
|
|
- tempSignatureConfig.ImageData = GetDrawInk(ref height,ref width);
|
|
|
+ tempSignatureConfig.ImageData = GetDrawInk(ref height, ref width);
|
|
|
tempSignatureConfig.ImageWidth = width;
|
|
|
tempSignatureConfig.ImageHeight = height;
|
|
|
CanvaDrawPopup.Visibility = Visibility.Collapsed;
|
|
@@ -382,7 +382,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
|
|
|
return rgbValues;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void SetProperty()
|
|
|
{
|
|
|
Text = string.Empty;
|
|
@@ -433,7 +433,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
|
Text += "DN: ";
|
|
|
}
|
|
|
- var keyOrder = new List<string> { "CN", "O", "OU", "emailAddress", "L", "ST", "C" };
|
|
|
+ var keyOrder = new List<string> { "CN", "O", "OU", "emailAddress", "L", "ST", "C" };
|
|
|
|
|
|
var keyMapping = new Dictionary<string, string>
|
|
|
{
|
|
@@ -461,7 +461,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Text += stringBuilder.ToString()+"\n";
|
|
|
+ Text += stringBuilder.ToString() + "\n";
|
|
|
}
|
|
|
|
|
|
if ((bool)ComPDFKitVersionChk.IsChecked)
|
|
@@ -484,11 +484,6 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
}
|
|
|
Text += PositionTbx.Text + "\n";
|
|
|
}
|
|
|
-
|
|
|
- if(DynamicAP.IsChecked==true)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
private void ReasonCheckBox_Click(object sender, RoutedEventArgs e)
|
|
@@ -531,9 +526,20 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void ClearTxt_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
|
+ private void ClearSignatureImage()
|
|
|
{
|
|
|
imagePath = string.Empty;
|
|
|
+ if (tempSignatureConfig != null)
|
|
|
+ {
|
|
|
+ tempSignatureConfig.ImageData = null;
|
|
|
+ tempSignatureConfig.ImageWidth = 0;
|
|
|
+ tempSignatureConfig.ImageHeight = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ClearTxt_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
|
+ {
|
|
|
+ ClearSignatureImage();
|
|
|
//tempSignatureConfig.ImageBitmap = null;
|
|
|
SetProperty();
|
|
|
CreateTempSignature();
|
|
@@ -574,6 +580,19 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
private void DynamicAPChk_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
ImageBorder.IsEnabled = DynamicAP.IsChecked == true ? false : true;
|
|
|
+ ImageBorder.Opacity = ImageBorder.IsEnabled ? 1 : 0.4;
|
|
|
+ ImagePickPanel.IsEnabled = DynamicAP.IsChecked == true ? false : true;
|
|
|
+ ImagePickPanel.Opacity = ImageBorder.IsEnabled ? 1 : 0.4;
|
|
|
+ LogoChk.IsEnabled= DynamicAP.IsChecked == true ? false : true;
|
|
|
+ LogoChk.Opacity = LogoChk.IsEnabled ? 1 : 0.4;
|
|
|
+ TrackpadBorder.IsEnabled = DynamicAP.IsChecked == true ? false : true;
|
|
|
+ TrackpadBorder.Opacity = ImageBorder.IsEnabled ? 1 : 0.4;
|
|
|
+
|
|
|
+ if (DynamicAP.IsChecked == true)
|
|
|
+ {
|
|
|
+ LogoChk.IsChecked = false;
|
|
|
+ ClearSignatureImage();
|
|
|
+ }
|
|
|
SetProperty();
|
|
|
CreateTempSignature();
|
|
|
}
|
|
@@ -662,7 +681,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
|
location = string.Empty;
|
|
|
}
|
|
|
-
|
|
|
+ signatureWidget.UpdateFormAp();
|
|
|
if (DynamicAP.IsChecked == true)
|
|
|
{
|
|
|
signatureWidget.SetSignAP();
|
|
@@ -672,7 +691,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
|
signatureWidget.UpdateApWithSignature(tempSignatureConfig);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (Document.WriteSignatureToFilePath(signatureWidget, filePath, SignaturePath, Password, location, reason, CPDFSignaturePermissions.CPDFSignaturePermissionsNone))
|
|
|
{
|
|
|
signatureCertificate.AddToTrustedCertificates();
|