ソースを参照

compdfkit(win) - 部分bug修复&导入导出xfdf

weixiangjie 1 年間 前
コミット
bb8d680529

+ 1 - 1
Demo/Examples/Annotations/MainWindow.xaml

@@ -250,7 +250,7 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
+                    <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Document Info</TextBlock>
                     <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
                         <Button.Content>
                             <Path Fill="Black">

ファイルの差分が大きいため隠しています
+ 16 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListControl/CPDFAnnotationListControl.xaml


+ 33 - 0
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListControl/CPDFAnnotationListControl.xaml.cs

@@ -1,8 +1,10 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using System.Collections.Generic;
+using System.IO;
 using System.Windows;
 using System.Windows.Controls;
+using Compdfkit_Tools.Helper;
 using static Compdfkit_Tools.PDFControlUI.CPDFAnnoationListUI;
 
 namespace Compdfkit_Tools.PDFControl
@@ -111,5 +113,36 @@ namespace Compdfkit_Tools.PDFControl
             var bindAnnotationResult = e as BindAnnotationResult;
             pdfViewer.SelectAnnotation(bindAnnotationResult.PageIndex, bindAnnotationResult.AnnotIndex);
         }
+
+        private void ImportBtn_Click(object sender, RoutedEventArgs e)
+        {
+            var selectedPath = CommonHelper.GetExistedPathOrEmpty("XFDF Files (*.xfdf)|*.xfdf");
+            if (string.IsNullOrEmpty(selectedPath)) return;
+            var tempPath = Path.Combine(Path.GetDirectoryName(selectedPath), "temp");
+            if (!Directory.Exists(tempPath))
+            {
+                Directory.CreateDirectory(tempPath);
+            }
+            pdfViewer.Document.ImportAnnotationFromXFDFPath(selectedPath,tempPath);
+                
+            LoadAnnotationList();
+            pdfViewer.UndoManager.CanSave = true;
+        }
+
+        private void ExportBtn_Click(object sender, RoutedEventArgs e)
+        {
+            var selectedPath = CommonHelper.GetGeneratePathOrEmpty("XFDF Files (*.xfdf)|*.xfdf",pdfViewer.Document.FileName);
+            if (string.IsNullOrEmpty(selectedPath)) return;
+            var tempPath = Path.Combine(Path.GetDirectoryName(selectedPath), "temp");
+            if (!Directory.Exists(tempPath))
+            {
+                Directory.CreateDirectory(tempPath);
+            }
+
+            if (pdfViewer.Document.ExportAnnotationToXFDFPath(selectedPath, tempPath))
+            {
+                System.Diagnostics.Process.Start("explorer.exe", "/select," + selectedPath);
+            }
+        }
     }
 }

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFShapeUI.xaml

@@ -20,7 +20,7 @@
                     <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
                 </StackPanel>
                 <StackPanel Height="75" Margin="5">
-                    <TextBlock Text="Line Color"></TextBlock>
+                    <TextBlock Text="Stroke Color"></TextBlock>
                     <cpdfcommon:ColorPickerControl x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
                 </StackPanel>
                 <StackPanel x:Name="FillColorStackPanel" Height="75" Margin="5">

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Common/HomePage/RecentFilesControl.xaml

@@ -82,7 +82,7 @@
             <RowDefinition Height="Auto"/>
             <RowDefinition Height="*"/>
         </Grid.RowDefinitions>
-        <TextBlock Text="Quick Start" Background="Transparent" Margin="0,0,0,25" Height="32" FontFamily="Segoe UI" FontSize="24" LineHeight="32" Foreground="#001A4E"></TextBlock>
+        <TextBlock Text="Quick Start" Background="Transparent" Margin="40,0,0,25" Height="32" FontFamily="Segoe UI" FontSize="24" LineHeight="32" Foreground="#001A4E"></TextBlock>
         <ListView Grid.Row="1" x:Name="HistoryListView" MinWidth="380"
                   ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                   Style="{StaticResource HistoryListBoxStyle}" ItemsSource="{Binding History}" 

+ 0 - 2
Demo/Examples/Compdfkit_Tools/Common/PreviewControl/PreviewControl.xaml

@@ -8,8 +8,6 @@
              d:DesignHeight="449" d:DesignWidth="248" Loaded="UserControl_Loaded">
     <UserControl.Resources>
         <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-            </ResourceDictionary.MergedDictionaries>
             <Style x:Key="TransparentButtonStyle" TargetType="{x:Type Button}">
                 <Setter Property="BorderThickness" Value="0" />
                 <Setter Property="Template">

+ 1 - 1
Demo/Examples/ContentEditor/MainWindow.xaml

@@ -266,7 +266,7 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
+                    <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Document Info</TextBlock>
                     <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
                         <Button.Content>
                             <Path Fill="Black">

+ 1 - 1
Demo/Examples/DigitalSignature/MainWindow.xaml

@@ -245,7 +245,7 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
+                    <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Document Info</TextBlock>
                     <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
                         <Button.Content>
                             <Path Fill="Black">

+ 1 - 1
Demo/Examples/DocsEditor/DocsEditor.csproj

@@ -7,7 +7,7 @@
     <ProjectGuid>{D3003B68-0D1E-47B2-84CA-D6B749BABC74}</ProjectGuid>
     <OutputType>WinExe</OutputType>
     <RootNamespace>DocsEditControl</RootNamespace>
-    <AssemblyName>Docs Editor_ComPDFKit</AssemblyName>
+    <AssemblyName>Document Editor_ComPDFKit</AssemblyName>
     <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

+ 2 - 2
Demo/Examples/DocsEditor/MainWindow.xaml

@@ -7,7 +7,7 @@
         xmlns:local="clr-namespace:DocsEditor"
         xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
         mc:Ignorable="d"
-        Title="Docs Editor_ComPDFKit V1.10.0" Height="450" Width="800">
+        Title="Document Editor_ComPDFKit V1.10.0" Height="450" Width="800">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -299,7 +299,7 @@
                                     <RowDefinition Height="*"></RowDefinition>
                                 </Grid.RowDefinitions>
 
-                                <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
+                                <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Document Info</TextBlock>
                                 <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
                                     <Button.Content>
                                         <Path Fill="Black">

+ 2 - 2
Demo/Examples/DocsEditor/Properties/AssemblyInfo.cs

@@ -7,11 +7,11 @@ using System.Windows;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("Docs Editor_ComPDFKit")]
+[assembly: AssemblyTitle("Document Editor_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("PDF Tecnologies, Inc.")]
-[assembly: AssemblyProduct("Docs Editor_ComPDFKit")]
+[assembly: AssemblyProduct("Document Editor_ComPDFKit")]
 [assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

+ 1 - 1
Demo/Examples/Forms/MainWindow.xaml

@@ -250,7 +250,7 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
+                    <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Document Info:</TextBlock>
                     <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
                         <Button.Content>
                             <Path Fill="Black">

+ 2 - 2
Demo/Examples/PDFViewer/MainPage.xaml

@@ -178,7 +178,7 @@
                     <ComboBoxItem Tag="Annotation">Annotation</ComboBoxItem>
                     <ComboBoxItem Tag="Form">Form</ComboBoxItem>
                     <ComboBoxItem Tag="Content Editor">Content Editor</ComboBoxItem>
-                    <ComboBoxItem Tag="Docs Editor">Docs Editor</ComboBoxItem>
+                    <ComboBoxItem Tag="Document Editor">Document Editor</ComboBoxItem>
                     <ComboBoxItem Tag="Digital Signature">Digital Signature</ComboBoxItem>
                 </ComboBox>
 
@@ -309,7 +309,7 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
+                    <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Document Info</TextBlock>
                     <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
                         <Button.Content>
                             <Path Fill="Black">

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

@@ -105,7 +105,7 @@ namespace PDFViewer
 
         private Visibility _notDocsEditorVisible = Visibility.Visible;
         /// <summary>
-        /// Whether the Docs Editor panel is visible.
+        /// Whether the Document Editor panel is visible.
         /// </summary>
         public Visibility NotDocsEditorVisible
         {
@@ -442,7 +442,7 @@ namespace PDFViewer
                 contentEditControl.ClearViewerControl();
                 contentEditControl.ClearPDFEditState();
             }
-            else if (currentMode == "Docs Editor")
+            else if (currentMode == "Document Editor")
             {
                 pageEditControl.ExitPageEdit -= PageEditControl_ExitPageEdit;
                 NotDocsEditorVisible = Visibility.Visible;
@@ -526,7 +526,7 @@ namespace PDFViewer
                     contentEditControl.SetDisplaySettingsControl(displaySettingsControl);
                 }
             }
-            else if (item.Content as string == "Docs Editor")
+            else if (item.Content as string == "Document Editor")
             {
                 pageEditControl.PDFViewControl = pdfViewer;
                 pageEditControl.ExitPageEdit += PageEditControl_ExitPageEdit;

+ 1 - 1
Demo/Examples/PDFViewer/SettingsDialog.xaml

@@ -163,7 +163,7 @@
             </Grid>
             <Grid Margin="0,0,0,8" Height="20">
                 <TextBlock Text="Email Address" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
-                <Button Style="{StaticResource UnderlinedButtonStyle}" HorizontalAlignment="Right" Tag="" Content="support@compdf.com"></Button>
+                <Button Style="{StaticResource UnderlinedButtonStyle}" HorizontalAlignment="Right" Tag="mailto:support@compdf.com" Content="support@compdf.com"></Button>
             </Grid>
             <Grid Margin="0,0,0,8" Height="20">
                 <TextBlock Text="Technical Support" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>