Browse Source

annotation(windows) - 图片注释

liuaoran 1 year ago
parent
commit
f40bb9f11b
17 changed files with 262 additions and 178 deletions
  1. 22 21
      compdfkit_demo_windows/compdfkit/annotation-ctrl-demo/MainWindow.xaml.cs
  2. 2 1
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml
  3. 20 0
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml.cs
  4. 1 1
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateStampDialog.xaml
  5. 29 27
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreeTextUI.xaml
  6. 4 1
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreehandUI.xaml
  7. 32 19
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml
  8. 2 1
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml.cs
  9. 30 28
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFMarkupUI.xaml
  10. 21 19
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFNoteUI.xaml
  11. 42 40
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFShapeUI.xaml
  12. 19 17
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFTempStampUI.xaml
  13. 34 0
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/Convert/StringToVisibilityConvert.cs
  14. 1 1
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/PropertyControl/PDFArrow/CPDFArrowUI.xaml
  15. 1 1
      compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/PropertyControl/PDFLineStyle/CPDFLineStyleUI.xaml
  16. 1 0
      compdfkit_demo_windows/compdfkit/compdfkit-tools/compdfkit-tools.csproj
  17. 1 1
      compdfkit_demo_windows/compdfkit/form-ctrl-demo/MainWindow.xaml

+ 22 - 21
compdfkit_demo_windows/compdfkit/annotation-ctrl-demo/MainWindow.xaml.cs

@@ -700,27 +700,28 @@ namespace viewer_ctrl_demo
 
         private void AnnotationBarControl_AnnotationPropertyChanged(object sender, CPDFAnnotationType e)
         {
-            if(e==CPDFAnnotationType.Image)
-            {
-                pdfAnnotationControl.ClearPanel();
-                pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
-                StampAnnotArgs stampArgs = new StampAnnotArgs();
-                stampArgs.Opacity = 1;
-                stampArgs.Type = StampType.IMAGE_STAMP;
-                OpenFileDialog openFileDialog = new OpenFileDialog();
-                openFileDialog.Filter = "Image Files(*.jpg;*.jpeg;*.png;*.bmp)|*.jpg;*.jpeg;*.png;*.bmp;";
-                if (openFileDialog.ShowDialog() == true)
-                {
-                    stampArgs.ImagePath = openFileDialog.FileName;
+            //TODO:测试没有问题的话就删除
+            //if(e==CPDFAnnotationType.Image)
+            //{
+            //    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
+            //    StampAnnotArgs stampArgs = new StampAnnotArgs();
+            //    stampArgs.Opacity = 1;
+            //    stampArgs.Type = StampType.IMAGE_STAMP;
+            //    OpenFileDialog openFileDialog = new OpenFileDialog();
+            //    openFileDialog.Filter = "Image Files(*.jpg;*.jpeg;*.png;*.bmp)|*.jpg;*.jpeg;*.png;*.bmp;";
+            //    if (openFileDialog.ShowDialog() == true)
+            //    {
+            //        stampArgs.ImagePath = openFileDialog.FileName;
                  
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.AnnotCreate);
-                    pdfViewControl.PDFView?.SetToolParam(stampArgs);
-                }
-                (sender as ToggleButton).IsChecked = false;
-                return;
-            }
+            //        pdfViewControl.PDFView?.SetMouseMode(MouseModes.AnnotCreate);
+            //        pdfViewControl.PDFView?.SetToolParam(stampArgs);
+            //        ExpandRightPropertyPanel(null, Visibility.Collapsed);
+            //    }
+            //    (sender as ToggleButton).IsChecked = false;
+            //    return;
+            //}
             pdfAnnotationControl.LoadAnnotationPanel(e);
-            if (e != CPDFAnnotationType.Audio)
+            if (e != CPDFAnnotationType.Audio && e != CPDFAnnotationType.Image)
             {
                 ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
                 AnnotationBarBtn.IsChecked = true;
@@ -750,10 +751,10 @@ namespace viewer_ctrl_demo
             }
         }
 
-        public void ExpandRightPropertyPanel(UIElement properytPanel, Visibility visible)
+        public void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
         {
             PropertyContainer.Width = 260;
-            PropertyContainer.Child = properytPanel;
+            PropertyContainer.Child = propertytPanel;
             PropertyContainer.Visibility = visible;
             if (visible == Visibility.Collapsed || visible == Visibility.Hidden)
             {

+ 2 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml

@@ -9,7 +9,8 @@
              Unloaded="AnnotationControl_Unloaded"
              d:DesignHeight="800" d:DesignWidth="300">
     <Grid>
-        <Border x:Name="AnnotationPanelContainer" Background="#FFFFFF"></Border>
+            <Border x:Name="AnnotationPanelContainer" Background="#FFFFFF"></Border>
         <TextBlock x:Name="EmptyMessage" Text="The annotation panel has escaped" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
+
     </Grid>
 </UserControl>

+ 20 - 0
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml.cs

@@ -623,6 +623,26 @@ namespace compdfkit_tools.PDFControl
                     }
                     ClearPanel();
                     break;
+                case CPDFAnnotationType.Image:
+                    StampAnnotArgs stampArgs = new StampAnnotArgs();
+                    stampArgs.Opacity = 1;
+                    stampArgs.Type = StampType.IMAGE_STAMP;
+                    OpenFileDialog openFileDialog = new OpenFileDialog();
+                    openFileDialog.Filter = "Image Files(*.jpg;*.jpeg;*.png;*.bmp)|*.jpg;*.jpeg;*.png;*.bmp;";
+                    if (openFileDialog.ShowDialog() == true)
+                    {
+                        stampArgs.ImagePath = openFileDialog.FileName;
+
+                        this.pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
+                        this.pdfViewer?.SetToolParam(stampArgs);
+                    }
+                    else
+                    {
+                        this.pdfViewer.SetMouseMode(MouseModes.PanTool);
+                    } 
+                    ClearAnnotationBar?.Invoke(this, EventArgs.Empty);
+                    ClearPanel();
+                    break;
                 default:
                     break;
             }

+ 1 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateStampDialog.xaml

@@ -400,7 +400,7 @@
             <Button Content="Clear" Click="Clear_Click"  Height="32" Width="72" HorizontalAlignment="Left"/>
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
                 <Button Content="Cancel" Click="Cancel_Click" Width="81" Height="32"/>
-                <Button Content="Save" Click="Save_Click" x:Name="SaveBtn" Width="136" Height="32"  Margin="8,0,0,0" IsEnabled="False" Style="{StaticResource ButtonStyle}"/>
+                <Button Content="Save" Click="Save_Click" x:Name="SaveBtn" Width="136" Height="32"  Margin="8,0,0,0" IsEnabled="True" Style="{StaticResource ButtonStyle}"/>
             </StackPanel>
         </Grid>
     </Grid>

+ 29 - 27
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreeTextUI.xaml

@@ -8,33 +8,35 @@
              xmlns:cpdftools="clr-namespace:compdfkit_tools.PDFControl"
              mc:Ignorable="d" 
              d:DesignHeight="800" d:DesignWidth="300">
-    <Grid Background="#FAFCFF">
-        <StackPanel Orientation="Vertical">
-            <Border BorderThickness="1" BorderBrush="#1A000000">
-                <Grid  Height="40" Background="White" >
-                    <TextBlock x:Name="TitileTextBlock" Text="Text Box" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
-                </Grid>
-            </Border>
-            <StackPanel Orientation="Vertical" Height="150">
-                <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
+    <ScrollViewer VerticalScrollBarVisibility="Auto"> 
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitileTextBlock" Text="Text Box" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Orientation="Vertical" Height="150">
+                    <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
+                </StackPanel>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Font Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="ColorPickerControl"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+                <StackPanel Height="120" Margin="5">
+                    <TextBlock Text="Font Style"></TextBlock>
+                    <cpdfcommon:CPDFFontControl x:Name="CPDFFontControl" Width="228"></cpdfcommon:CPDFFontControl>
+                </StackPanel>
+                <StackPanel Height="200" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
             </StackPanel>
-            <StackPanel Height="75" Margin="5">
-                <TextBlock Text="Font Color"></TextBlock>
-                <cpdfcommon:ColorPickerControl x:Name="ColorPickerControl" TransparentBtnProperty="Collapsed"></cpdfcommon:ColorPickerControl>
-            </StackPanel>
-            <StackPanel Height="75" Margin="5">
-                <TextBlock Text="Opacity"></TextBlock>
-                <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
-            </StackPanel>
-            <StackPanel Height="120" Margin="5">
-                <TextBlock Text="Font Style"></TextBlock>
-                <cpdfcommon:CPDFFontControl x:Name="CPDFFontControl" Width="228"></cpdfcommon:CPDFFontControl>
-            </StackPanel>
-            <StackPanel Height="200" Margin="5">
-                <TextBlock Text="Note"></TextBlock>
-                <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
-            </StackPanel>
-        </StackPanel>
-    </Grid>
+        </Grid>
+    </ScrollViewer>
 </UserControl>
 

+ 4 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreehandUI.xaml

@@ -15,7 +15,8 @@
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid Background="#FAFCFF">
+    <ScrollViewer VerticalScrollBarVisibility="Auto"> 
+        <Grid Background="#FAFCFF">
         <StackPanel Orientation="Vertical">
             <Border BorderThickness="1" BorderBrush="#1A000000">
                 <Grid  Height="40" Background="White" >
@@ -89,4 +90,6 @@
            
         </StackPanel>
     </Grid>
+    </ScrollViewer>
+
 </UserControl>

+ 32 - 19
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml

@@ -4,10 +4,12 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:compdfkit_tools.Annotation.PDFAnnotationUI"
+             xmlns:cpdfcommon="clr-namespace:compdfkit_tools.Common"
              mc:Ignorable="d" 
              Loaded="UserControl_Loaded"
              d:DesignHeight="450" d:DesignWidth="800">
     <UserControl.Resources>
+        <cpdfcommon:StringToVisibilityConvert x:Key="StringToVisibilityConvert"></cpdfcommon:StringToVisibilityConvert>
         <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
         <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
         <Style x:Key="TabControlStyle1" TargetType="{x:Type TabControl}">
@@ -299,7 +301,7 @@
                     <ControlTemplate TargetType="{x:Type TextBox}">
                         <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                             <Grid>
-                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
+                                <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                                 <Button
                                     Name="PART_BtnClear"
                                     Grid.Column="1"
@@ -415,22 +417,33 @@
             </Setter>
         </Style>
     </UserControl.Resources>
-    <Grid Background="#FFFFFF">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="100"/>
-            <RowDefinition Height="*"/>
-        </Grid.RowDefinitions>
-        <TabControl x:Name="HeadTabControl" Style="{DynamicResource TabControlStyle1}">
-            <TabItem Style="{DynamicResource TabItemStyle1}" Header="Hyperlink">
-                <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="UrlText" VerticalContentAlignment="Center" TextChanged="UrlText_TextChanged" HorizontalContentAlignment="Center" TextAlignment="Center" VerticalAlignment="Center" Margin="16"/>
-            </TabItem>
-            <TabItem Style="{DynamicResource TabItemStyle1}" Header="Go To Pages">
-                <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="PageText" VerticalContentAlignment="Center" TextChanged="PageText_TextChanged" HorizontalContentAlignment="Center" TextAlignment="Center" VerticalAlignment="Center" Margin="16"/>
-            </TabItem>
-            <TabItem Style="{DynamicResource TabItemStyle1}" Header="Email">
-                <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="EmailText" VerticalContentAlignment="Center"  TextChanged="EmailText_TextChanged" HorizontalContentAlignment="Center" TextAlignment="Center" VerticalAlignment="Center" Margin="16"/>
-            </TabItem>
-        </TabControl>
-        <Button Style="{DynamicResource ButtonStyle1}" x:Name="SaveBtn"  Background="#001A4E" Width="120" Height="32" Grid.Row="1" Foreground="#FFFFFF" Content="Save" VerticalAlignment="Top" Click="Save_Click" IsEnabled="False"/>
-    </Grid>
+    <ScrollViewer VerticalScrollBarVisibility="Auto">
+        <Grid Background="#FFFFFF">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="100"/>
+                <RowDefinition Height="*"/>
+            </Grid.RowDefinitions>
+            <TabControl x:Name="HeadTabControl" Style="{DynamicResource TabControlStyle1}">
+                <TabItem Style="{DynamicResource TabItemStyle1}" Header="Hyperlink">
+                    <Grid>
+                        <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="UrlText" VerticalContentAlignment="Center" TextChanged="UrlText_TextChanged" VerticalAlignment="Center" Margin="16"/>
+                        <TextBlock Text="Website URL" VerticalAlignment="Center"  Margin="22" Visibility="{Binding ElementName=UrlText, Path=Text, Converter={StaticResource StringToVisibilityConvert}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
+                    </Grid>
+                </TabItem>
+                <TabItem Style="{DynamicResource TabItemStyle1}" Header="Go To Pages">
+                    <Grid>
+                        <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="PageText" VerticalContentAlignment="Center" TextChanged="PageText_TextChanged" VerticalAlignment="Center" Margin="16"/>
+                        <TextBlock Text="Page Number" VerticalAlignment="Center"  Margin="22" Visibility="{Binding ElementName=PageText, Path=Text, Converter={StaticResource StringToVisibilityConvert}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
+                    </Grid>
+                </TabItem>
+                <TabItem Style="{DynamicResource TabItemStyle1}" Header="Email">
+                    <Grid>
+                        <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="EmailText" VerticalContentAlignment="Center"  TextChanged="EmailText_TextChanged" VerticalAlignment="Center" Margin="16"/>
+                        <TextBlock Text="Email" VerticalAlignment="Center"  Margin="22" Visibility="{Binding ElementName=EmailText, Path=Text, Converter={StaticResource StringToVisibilityConvert}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
+                    </Grid>
+                </TabItem>
+            </TabControl>
+            <Button Style="{DynamicResource ButtonStyle1}" x:Name="SaveBtn"  Background="#001A4E" Width="120" Height="32" Grid.Row="1" Foreground="#FFFFFF" Content="Save" VerticalAlignment="Top" Click="Save_Click" IsEnabled="False"/>
+        </Grid>
+    </ScrollViewer>
 </UserControl>

+ 2 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml.cs

@@ -41,7 +41,6 @@ namespace compdfkit_tools.Annotation.PDFAnnotationUI
         }
 
         private int selectedIndex = 0;
-
         public int SelectedIndex
         {
             get { return selectedIndex; }
@@ -52,10 +51,12 @@ namespace compdfkit_tools.Annotation.PDFAnnotationUI
                 OnPropertyChanged("SelectedIndex");
             }
         }
+
         public CPDFLinkUI()
         {
             InitializeComponent();
         }
+
         public void SetPresentAnnotAttrib(AnnotAttribEvent AttribEvent, int PageCount)
         {
             annotAttribEvent = AttribEvent;

+ 30 - 28
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFMarkupUI.xaml

@@ -7,34 +7,36 @@
              xmlns:cpdftools="clr-namespace:compdfkit_tools.PDFControl"
              mc:Ignorable="d" 
                d:DesignHeight="800" d:DesignWidth="300">
-    <Grid Background="#FAFCFF">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="170"></RowDefinition>
-            <RowDefinition Height="80"></RowDefinition>
-            <RowDefinition Height="80"></RowDefinition>
-            <RowDefinition Height="200"></RowDefinition>
-            <RowDefinition></RowDefinition>
-        </Grid.RowDefinitions>
-        <StackPanel Orientation="Vertical">
-            <Border BorderThickness="1" BorderBrush="#1A000000">
-                <Grid  Height="40" Background="White" >
-                    <TextBlock x:Name="TitleTextBlock"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
-                </Grid>
-            </Border>
-            <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
+    <ScrollViewer VerticalScrollBarVisibility="Auto"> 
+        <Grid Background="#FAFCFF">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="170"></RowDefinition>
+                <RowDefinition Height="80"></RowDefinition>
+                <RowDefinition Height="80"></RowDefinition>
+                <RowDefinition Height="200"></RowDefinition>
+                <RowDefinition></RowDefinition>
+            </Grid.RowDefinitions>
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitleTextBlock"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
             </StackPanel>
-                <StackPanel Grid.Row="1" Margin="5">
-                    <TextBlock Text="Color"></TextBlock>
-            <cpdfcommon:ColorPickerControl x:Name="ColorPickerControl" TransparentBtnProperty="Collapsed"></cpdfcommon:ColorPickerControl>
-                </StackPanel>
-                <StackPanel Grid.Row="2" Margin="5">
-                    <TextBlock Text="Opacity"></TextBlock>
-                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
-                </StackPanel>
-                <StackPanel Grid.Row="3" Margin="5">
-                    <TextBlock Text="Note"></TextBlock>
-            <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
-                </StackPanel>
-    </Grid>
+            <StackPanel Grid.Row="1" Margin="5">
+                <TextBlock Text="Color"></TextBlock>
+                <cpdfcommon:ColorPickerControl x:Name="ColorPickerControl" TransparentBtnProperty="Collapsed"></cpdfcommon:ColorPickerControl>
+            </StackPanel>
+            <StackPanel Grid.Row="2" Margin="5">
+                <TextBlock Text="Opacity"></TextBlock>
+                <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+            </StackPanel>
+            <StackPanel Grid.Row="3" Margin="5">
+                <TextBlock Text="Note"></TextBlock>
+                <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+            </StackPanel>
+        </Grid>
+    </ScrollViewer>
 </UserControl>
 

+ 21 - 19
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFNoteUI.xaml

@@ -8,25 +8,27 @@
              xmlns:cpdftools="clr-namespace:compdfkit_tools.PDFControl"
              mc:Ignorable="d" 
              d:DesignHeight="800" d:DesignWidth="300">
-    <Grid Background="#FAFCFF">
-        <StackPanel Orientation="Vertical">
-            <Border BorderThickness="1" BorderBrush="#1A000000">
-                <Grid  Height="40" Background="White" >
-                    <TextBlock x:Name="TitileTextBlock" Text="Note" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
-                </Grid>
-            </Border>
-            <StackPanel Orientation="Vertical" Height="130">
-                <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
+    <ScrollViewer VerticalScrollBarVisibility="Auto"> 
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitileTextBlock" Text="Note" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Orientation="Vertical" Height="130">
+                    <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
+                </StackPanel>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Border Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="ColorPickerControl" TransparentBtnProperty="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="200" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
             </StackPanel>
-            <StackPanel Height="75" Margin="5">
-                <TextBlock Text="Border Color"></TextBlock>
-                <cpdfcommon:ColorPickerControl x:Name="ColorPickerControl" TransparentBtnProperty="Collapsed"></cpdfcommon:ColorPickerControl>
-            </StackPanel>
-            <StackPanel Height="200" Margin="5">
-                <TextBlock Text="Note"></TextBlock>
-                <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
-            </StackPanel>
-        </StackPanel>
-    </Grid>
+        </Grid>
+    </ScrollViewer>
 </UserControl>
 

+ 42 - 40
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFShapeUI.xaml

@@ -8,44 +8,46 @@
             xmlns:cpdfcommon="clr-namespace:compdfkit_tools.Common"
              mc:Ignorable="d" 
              d:DesignHeight="800" d:DesignWidth="300">
-    <Grid Background="#FAFCFF">
-        <StackPanel Orientation="Vertical">
-            <Border BorderThickness="1" BorderBrush="#1A000000">
-                <Grid  Height="40" Background="White" >
-                    <TextBlock x:Name="TitleTextBlock"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
-                </Grid>
-            </Border>
-            <StackPanel Orientation="Vertical" Height="130">
-                <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
-            </StackPanel>
-            <StackPanel Height="75" Margin="5">
-                <TextBlock Text="Line Color"></TextBlock>
-                <cpdfcommon:ColorPickerControl x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
-            </StackPanel>
-            <StackPanel x:Name="FillColorStackPanel" Height="75" Margin="5">
-                <TextBlock Text="Fill Color"></TextBlock>
-                <cpdfcommon:ColorPickerControl x:Name="FillColorPickerControl" Brush="Transparent"></cpdfcommon:ColorPickerControl>
-            </StackPanel>
-            <StackPanel Height="60" Margin="5">
-                <TextBlock Text="Opacity"></TextBlock>
-                <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
-            </StackPanel>
-            <StackPanel Height="60" Margin="5">
-                <TextBlock Text="Line Width"></TextBlock>
-                <cpdfcommon:CPDFThicknessControl x:Name="CPDFThicknessControl"></cpdfcommon:CPDFThicknessControl>
-            </StackPanel>
-            <StackPanel x:Name="LineStyleStackPanel" Height="90" Margin="5">
-                <TextBlock Text="Line and Border Style"></TextBlock>
-                <cpdfcommon:CPDFLineStyleControl x:Name="CPDFLineStyleControl"></cpdfcommon:CPDFLineStyleControl>
-            </StackPanel>
-            <StackPanel x:Name="ArrowStackPanel" Visibility="Visible" Height="75"  Margin="5">
-                <TextBlock Text="Start and End"></TextBlock>
-                <cpdfcommon:CPDFArrowControl x:Name="CPDFArrowControl"></cpdfcommon:CPDFArrowControl>
-            </StackPanel>
-            <StackPanel Height="160" Margin="5">
-                <TextBlock Text="Note"></TextBlock>
-                <TextBox Height="100"  x:Name="NoteTextBox"  TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
-            </StackPanel>
-        </StackPanel>
-    </Grid>
+    <ScrollViewer VerticalScrollBarVisibility="Auto"> 
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitleTextBlock"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Orientation="Vertical" Height="130">
+                    <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16"></cpdftools:CPDFAnnotationPreviewerControl>
+                </StackPanel>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Line Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel x:Name="FillColorStackPanel" Height="75" Margin="5">
+                    <TextBlock Text="Fill Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="FillColorPickerControl" Brush="Transparent"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Line Width"></TextBlock>
+                    <cpdfcommon:CPDFThicknessControl x:Name="CPDFThicknessControl"></cpdfcommon:CPDFThicknessControl>
+                </StackPanel>
+                <StackPanel x:Name="LineStyleStackPanel" Height="90" Margin="5">
+                    <TextBlock Text="Line and Border Style"></TextBlock>
+                    <cpdfcommon:CPDFLineStyleControl x:Name="CPDFLineStyleControl"></cpdfcommon:CPDFLineStyleControl>
+                </StackPanel>
+                <StackPanel x:Name="ArrowStackPanel" Visibility="Visible" Height="75"  Margin="5">
+                    <TextBlock Text="Start and End"></TextBlock>
+                    <cpdfcommon:CPDFArrowControl x:Name="CPDFArrowControl"></cpdfcommon:CPDFArrowControl>
+                </StackPanel>
+                <StackPanel Height="160" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="100"  x:Name="NoteTextBox"  TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+    </ScrollViewer>
 </UserControl>

+ 19 - 17
compdfkit_demo_windows/compdfkit/compdfkit-tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFTempStampUI.xaml

@@ -7,22 +7,24 @@
              xmlns:local="clr-namespace:compdfkit_tools.PDFControlUI"
              mc:Ignorable="d" 
              d:DesignHeight="800" d:DesignWidth="300">
-    <Grid Background="#FAFCFF">
-        <StackPanel Orientation="Vertical">
-            <Border BorderThickness="1" BorderBrush="#1A000000">
-                <Grid  Height="40" Background="White" >
-            <TextBlock x:Name="TitileTextBlock" Text="Image"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
-                </Grid>
-            </Border>
-            <StackPanel Orientation="Vertical" Height="150">
-                <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16">
-                </cpdftools:CPDFAnnotationPreviewerControl>
+    <ScrollViewer VerticalScrollBarVisibility="Auto">
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitileTextBlock" Text="Image"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Orientation="Vertical" Height="150">
+                    <cpdftools:CPDFAnnotationPreviewerControl x:Name="CPDFAnnotationPreviewerControl" Height="100" Margin="16">
+                    </cpdftools:CPDFAnnotationPreviewerControl>
+                </StackPanel>
+
+                <StackPanel Height="200" Margin="16">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
             </StackPanel>
-            
-            <StackPanel Height="200" Margin="16">
-                <TextBlock Text="Note"></TextBlock>
-                <TextBox Height="150"  x:Name="NoteTextBox" TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
-            </StackPanel>
-        </StackPanel>   
-    </Grid>
+        </Grid>
+    </ScrollViewer>
 </UserControl>

+ 34 - 0
compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/Convert/StringToVisibilityConvert.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows;
+using System.Globalization;
+
+namespace compdfkit_tools.Common
+{
+    [ValueConversion(typeof(string), typeof(Visibility))]
+    public class StringToVisibilityConvert : IValueConverter
+    {
+        #region IValueConverter Members
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if ((value as string) == string.Empty)
+            {
+                return Visibility.Visible;
+            }
+            else
+            {
+                return Visibility.Collapsed;
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return null;
+        }
+        #endregion
+    }
+}

+ 1 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/PropertyControl/PDFArrow/CPDFArrowUI.xaml

@@ -148,7 +148,7 @@
                 </ComboBoxItem>
 
                 <ComboBoxItem  VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource ComboxItemTemplate}">
-                    <Path Fill="#000000" Tag="RArrow" Height="20">
+                    <Path Fill="#000000" Tag="RArrow" Height="20" >
                         <Path.Data>
                             M5.58660083,5.07600085 L9.46460189,7.49900085 L34,7.5 L34,8.5 L9.46460189,8.49900085 L5.58660083,10.9239992 L5.05660189,10.0760008 L8.37960136,8 L5.05660189,5.92399915 L5.58660083,5.07600085 Z
                         </Path.Data>

+ 1 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/PropertyControl/PDFLineStyle/CPDFLineStyleUI.xaml

@@ -60,7 +60,7 @@
                     <Line Name="DashLineControl" Margin="10,0,0,0" Grid.Row="1" Grid.Column="1" Stroke="#000000" StrokeThickness="2" X1="0" Y1="0" X2="112" Y2="0" VerticalAlignment="Center" StrokeDashArray="0,1,1"></Line>
                 </RadioButton>
             </StackPanel>
-            <local:NumericUpDownControl x:Name="NumericUpDownControl" VerticalAlignment="Bottom" Margin="0,0,0,6" Text="{Binding DashSpacing, Mode=TwoWay}" Grid.Column="1" Width="72" Height="28" Unit="pt" Minimum="1" Maxium="100" IsEnabled="{Binding ElementName=DashRadioButton, Path=IsChecked}"></local:NumericUpDownControl>
+            <local:NumericUpDownControl x:Name="NumericUpDownControl" VerticalAlignment="Bottom" Text="{Binding DashSpacing, Mode=TwoWay}" Grid.Column="1" Width="72" Height="28" Unit="pt" Minimum="1" Maxium="10" IsEnabled="{Binding ElementName=DashRadioButton, Path=IsChecked}"></local:NumericUpDownControl>
         </Grid>
     </Grid>
 

+ 1 - 0
compdfkit_demo_windows/compdfkit/compdfkit-tools/compdfkit-tools.csproj

@@ -111,6 +111,7 @@
     <Compile Include="Common\Convert\IntAndTagToBoolMultiBinding.cs" />
     <Compile Include="Common\Convert\ReverseBoolConvert.cs" />
     <Compile Include="Common\Convert\ReverseVisibilityConvert.cs" />
+    <Compile Include="Common\Convert\StringToVisibilityConvert.cs" />
     <Compile Include="Common\Convert\WindowStateToPathConverter.cs" />
     <Compile Include="Common\Convert\WindowStateToThicknessConverter.cs" />
     <Compile Include="Common\PasswordControl\PasswordDialog.xaml.cs">

+ 1 - 1
compdfkit_demo_windows/compdfkit/form-ctrl-demo/MainWindow.xaml

@@ -7,7 +7,7 @@
         xmlns:cpdftools="clr-namespace:compdfkit_tools.PDFControl;assembly=com.compdfkit.tools" xmlns:form="clr-namespace:compdfkit_tools.Form;assembly=com.compdfkit.tools"
         xmlns:cpdfcommon="clr-namespace:compdfkit_tools.Common;assembly=com.compdfkit.tools"
         mc:Ignorable="d"
-        Title="Form" Height="960" Width="1280"  WindowStartupLocation="CenterScreen">
+        Title="Form" Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>