Browse Source

ComPDFKit Tool - 修复无法创建数字签名问题&stamp无法管理字体

liuaoran 11 months ago
parent
commit
5b06e7bba3

+ 3 - 10
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateStampDialog.xaml

@@ -349,8 +349,7 @@
                     <Grid Grid.Row="1" Grid.Column="2">
                         <Grid.RowDefinitions>
                             <RowDefinition Height="20"/>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="28"/>
+                            <RowDefinition Height="*"/> 
                             <RowDefinition Height="28"/>
                             <RowDefinition Height="20"/> 
                             <RowDefinition Height="20"/>
@@ -361,14 +360,8 @@
                             <TextBlock Margin="0,0,10,0" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Stamp_Text}" VerticalAlignment="Center"/>
                             <TextBox x:Name="StampText" Width="270" Margin="0,2,0,2" Text="Stamp Text" VerticalContentAlignment="Center" TextChanged="TextBox_TextChanged"/>
                         </StackPanel>
-                        <StackPanel Grid.Row="3" Orientation="Horizontal" Height="28">
-                            <TextBlock Margin="0,0,10,0" Text="字体" VerticalAlignment="Center"/>
-                            <ComboBox x:Name="FontNameCmb" Style="{StaticResource ComboBoxStyle1}" Height="26" Width="150" SelectionChanged="FontNameCmb_SelectionChanged" SelectedIndex="0"></ComboBox>
-                            <TextBlock Margin="6,0,10,0" Text="样式" VerticalAlignment="Center"></TextBlock>
-                            <ComboBox x:Name="StyleNameCmb" Style="{StaticResource ComboBoxStyle1}" Height="26" Width="80"  SelectionChanged="StyleNameCmb_SelectionChanged"></ComboBox>
-                        </StackPanel>
-                        <CheckBox Grid.Row="4" Name="Date" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Check_Date}" Checked="Date_Checked" Unchecked="Date_Unchecked"/>
-                        <CheckBox Grid.Row="6" Name="Time" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Check_Time}" Checked="Time_Checked" Unchecked="Time_Unchecked"/>
+                        <CheckBox Grid.Row="3" Name="Date" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Check_Date}" Checked="Date_Checked" Unchecked="Date_Unchecked"/>
+                        <CheckBox Grid.Row="4" Name="Time" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Check_Time}" Checked="Time_Checked" Unchecked="Time_Unchecked"/>
                     </Grid>
                     <StackPanel Grid.Row="1">
                         <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Stamp_Template}" VerticalAlignment="Center" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>

+ 1 - 15
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateStampDialog.xaml.cs

@@ -341,9 +341,7 @@ namespace Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI
 
             PageLoaded = true;
 
-            UpTextPreview();
-
-            FontNameCmb.ItemsSource = CPDFFont.GetFontNameDictionary().Keys;
+            UpTextPreview(); 
         }
 
 
@@ -511,17 +509,5 @@ namespace Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI
                 }
             }
         }
-
-        private void FontNameCmb_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            StyleNameCmb.ItemsSource = CPDFFont.GetFontNameDictionary()[FontNameCmb.SelectedValue.ToString()];
-            StyleNameCmb.SelectedIndex = 0;
-
-        }
-
-        private void StyleNameCmb_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-        }
     }
 }

+ 4 - 2
Demo/Examples/Compdfkit_Tools/DigitalSignature/FillDigitalSignatureControl/FillDigitalSignatureControl.xaml.cs

@@ -128,12 +128,14 @@ namespace Compdfkit_Tools.PDFControl
                     if (frame != null)
                     {
                         byte[] imageArray = new byte[frame.PixelWidth * frame.PixelHeight * 4];
-                        //int ImageWidth = frame.PixelWidth;
-                        //int ImageHeight = frame.PixelHeight;
+                        int ImageWidth = frame.PixelWidth;
+                        int ImageHeight = frame.PixelHeight;
                         frame.CopyPixels(imageArray, frame.PixelWidth * 4, 0);
                         if(signatureWidget.IsValid())
                         {
                             tempSignatureConfig.LogoData = imageArray;
+                            tempSignatureConfig.LogoWidth = ImageWidth;
+                            tempSignatureConfig.LogoHeight = ImageHeight;
                             //signatureWidget.UpdateApWithImage(ImageArray, ImageWidth, ImageHeight, C_Scale_Type.fitCenter, 0);
                         }
                     }