Browse Source

compdfkit(win) - 修复了水印错误的移动单位和·距离,补充了内容编辑特殊旋转角度缩略图刷新,

liuaoran 1 year ago
parent
commit
3656408ee0

+ 2 - 2
Demo/Examples/Compdfkit_Tools/Common/PropertyControl/PDFLocation/CPDFLocationControl.xaml

@@ -20,11 +20,11 @@
             </Grid.RowDefinitions>
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="4">
                 <TextBlock Text="X" VerticalAlignment="Center" Margin="0,0,8,0"></TextBlock>
-                <local:NumericUpDownControl x:Name="XNumericControl" Height="32" Width="90" Unit="mm" Text="{Binding HorizOffsetValue, Mode=TwoWay}"  Minimum="0" Maximum="99"></local:NumericUpDownControl>
+                <local:NumericUpDownControl x:Name="XNumericControl" Height="32" Width="90" Unit="mm" Text="{Binding HorizOffsetValue, Mode=TwoWay}"  Minimum="0" Maximum="199"></local:NumericUpDownControl>
             </StackPanel>
             <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="4">
                 <TextBlock Text="Y" VerticalAlignment="Center" Margin="0,0,8,0"></TextBlock>
-                <local:NumericUpDownControl x:Name="YNumericControl" Height="32" Width="90" Unit="mm"  Text="{Binding VertOffsetValue, Mode=TwoWay}"  Minimum="0" Maximum="99"></local:NumericUpDownControl>
+                <local:NumericUpDownControl x:Name="YNumericControl" Height="32" Width="90" Unit="mm"  Text="{Binding VertOffsetValue, Mode=TwoWay}"  Minimum="0" Maximum="199"></local:NumericUpDownControl>
             </StackPanel>
         </Grid>
     </Grid>

+ 2 - 2
Demo/Examples/Compdfkit_Tools/Common/PropertyControl/PDFLocation/CPDFRotationControl.xaml.cs

@@ -69,7 +69,7 @@ namespace Compdfkit_Tools.Common
             {
                 if (btn.Name == "CounterclockwiseBtn")
                 {
-                    RotationText = (int.Parse(RotationText) + 45).ToString();
+                    RotationText = (int.Parse(RotationText) - 45).ToString();
                 }
                 else if (btn.Name == "ResetBtn")
                 {
@@ -77,7 +77,7 @@ namespace Compdfkit_Tools.Common
                 }
                 else if (btn.Name == "ClockwiseBtn")
                 {
-                    RotationText = (int.Parse(RotationText) - 45).ToString();
+                    RotationText = (int.Parse(RotationText) + 45).ToString();
                 }
             }
         }

+ 2 - 0
Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs

@@ -347,6 +347,7 @@ namespace Compdfkit_Tools.Edit
                             imageShow.BeginInit();
                             imageShow.StreamSource = memoryStream;
                             imageShow.EndInit();
+
                             ImageThumbUI.Source = imageShow;
                             break;
                         }
@@ -372,6 +373,7 @@ namespace Compdfkit_Tools.Edit
             {
                 editEvent.Rotate = (int)absRotation;
                 editEvent.UpdatePDFEditByEventArgs();
+                SetImageThumb();
             }
         }
         

+ 11 - 3
Demo/Examples/Compdfkit_Tools/PDFView/PDFSearch/PDFSearchControl/CPDFSearchControl.xaml.cs

@@ -298,17 +298,26 @@ namespace Compdfkit_Tools.PDFControl
 
         private void SearchTog_Checked(object sender, RoutedEventArgs e)
         {
+            if (pdfView.UndoManager.CanSave)
+            {
+                pdfView.Document.WriteToLoadedPath();
+                pdfView.UndoManager.CanSave = false;
+            } 
             ReplaceTog.IsChecked = false;
             SearchInput.InputGrid.RowDefinitions[1].Height = new GridLength(0);
             SearchInput.Height = 40;
             ReplaceBorder.Visibility = Visibility.Collapsed;
             SearchResult.Visibility = Visibility.Visible;
-            ResultBorder.Visibility = Visibility.Visible;
-
+            ResultBorder.Visibility = Visibility.Visible; 
         }
 
         private void ReplaceTog_Checked(object sender, RoutedEventArgs e)
         {
+            if (pdfView.UndoManager.CanSave)
+            {
+                pdfView.Document.WriteToLoadedPath();
+                pdfView.UndoManager.CanSave = false;
+            }
             SearchTog.IsChecked = false;
             SearchInput.InputGrid.RowDefinitions[1].Height = new GridLength(1, GridUnitType.Star);
             SearchInput.Height = 80;
@@ -321,7 +330,6 @@ namespace Compdfkit_Tools.PDFControl
         private void ReplaceCurrent_Click(object sender, RoutedEventArgs e)
         {
             pdfView.ReplaceText(SearchInput.ReplaceWord);
-            pdfView.Document.WriteToLoadedPath();
         }
 
         private void ReplaceAll_Click(object sender, RoutedEventArgs e)

+ 3 - 2
Demo/Examples/Compdfkit_Tools/Watermark/AddWatermark/WatermarkDialog.xaml.cs

@@ -441,7 +441,8 @@ namespace Compdfkit_Tools.PDFControl
             var locationControl = sender as CPDFLocationControl;
             if (locationControl != null)
             {
-                HorizOffset = float.Parse(locationControl.HorizOffsetValue);
+ 
+                HorizOffset = (float)(float.Parse(locationControl.HorizOffsetValue) / 25.4 * 72.0);
             }
         }
 
@@ -450,7 +451,7 @@ namespace Compdfkit_Tools.PDFControl
             var locationControl = sender as CPDFLocationControl;
             if (locationControl != null)
             {
-                VertOffset = float.Parse(locationControl.VertOffsetValue);
+                VertOffset = (float)(float.Parse(locationControl.VertOffsetValue) / 25.4 *72);
             }
         }
 

+ 1 - 1
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -118,7 +118,7 @@ namespace PDFViewer
         public MainPage()
         {
             InitializeComponent();
-            this.DataContext = this;
+            this.DataContext = this; 
         }
         #endregion
 

+ 10 - 2
Demo/Examples/PDFViewer/MainWindow.xaml.cs

@@ -138,7 +138,15 @@ namespace PDFViewer
                 MainPage viewPage = new MainPage();
                 CPDFDocument document = CPDFDocument.CreateDocument();
                 document.SetInfo(new CPDFInfo
-                { Author = Properties.Settings.Default.DocumentAuthor, Creator = "ComPDFKit", CreationDate = DateTime.Now.ToString(), Subject = "Document", Producer = "ComPDFKit", Keywords = "Document", Version = "1.11.0" });
+                {
+                    Author = Properties.Settings.Default.DocumentAuthor,
+                    Creator = Assembly.GetExecutingAssembly().GetName().Name,
+                    CreationDate = DateTime.Now.ToString(),
+                    Subject = "Document",
+                    Producer = Assembly.GetExecutingAssembly().GetName().Name,
+                    Keywords = "Document",
+                    Version = string.Join(".", Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.').Take(3))
+                });
                 document.InsertPage(0, blankPageSetting.Size.Width * 7.2 / 2.54, blankPageSetting.Size.Height * 7.2 / 2.54, "");
                 if (blankPageSetting.Orientation == Orientation.Horizontal)
                 {
@@ -253,7 +261,7 @@ namespace PDFViewer
                 viewPage.Loaded += (sender, e) =>
                 {
                     viewPage.SetFeatureMode(featureName);
-                };
+                 };
             }
         }
 

BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.11.0/build/x64/ComPDFKit.dll