Skip to content

Commit f96d41d

Browse files
committed
v2.1.0 - Update
1 parent 0c88fb4 commit f96d41d

File tree

327 files changed

+14152
-4214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+14152
-4214
lines changed

ComPDFKit for Windows/Examples/Annotations/Annotations.csproj

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@
4141
<ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
4242
</PropertyGroup>
4343
<ItemGroup>
44-
<ProjectReference Include="..\Compdfkit.Controls\Compdfkit.Controls.csproj">
45-
<Project>{9363bcb1-3a67-446a-8093-5708b86bf418}</Project>
46-
<Name>Compdfkit.Controls</Name>
47-
</ProjectReference>
48-
<Reference Include="ComPDFKit.NET, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
49-
<HintPath>..\packages\ComPDFKit.NetFramework.2.0.0\lib\ComPDFKit.NET.dll</HintPath>
44+
<Reference Include="ComPDFKit.NET, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
45+
<HintPath>..\packages\ComPDFKit.NetFramework.2.1.3\lib\ComPDFKit.NET.dll</HintPath>
5046
</Reference>
51-
<Reference Include="ComPDFKit.Viewer, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
52-
<HintPath>..\packages\ComPDFKit.NetFramework.2.0.0\lib\ComPDFKit.Viewer.dll</HintPath>
47+
<Reference Include="ComPDFKit.Viewer, Version=2.1.3.0, Culture=neutral, processorArchitecture=MSIL">
48+
<HintPath>..\packages\ComPDFKit.NetFramework.2.1.3\lib\ComPDFKit.Viewer.dll</HintPath>
5349
</Reference>
5450
<Reference Include="PresentationFramework.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5551
<HintPath>..\packages\PresentationFramework.Aero2.1.0.1\lib\PresentationFramework.Aero2.dll</HintPath>
@@ -97,6 +93,7 @@
9793
<EmbeddedResource Include="Properties\Resources.resx">
9894
<Generator>ResXFileCodeGenerator</Generator>
9995
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
96+
<SubType>Designer</SubType>
10097
</EmbeddedResource>
10198
</ItemGroup>
10299
<ItemGroup>
@@ -127,11 +124,11 @@
127124
</Content>
128125
</ItemGroup>
129126
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
130-
<Import Project="..\packages\ComPDFKit.NetFramework.2.0.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\packages\ComPDFKit.NetFramework.2.0.0\build\ComPDFKit.NetFramework.targets')" />
127+
<Import Project="..\packages\ComPDFKit.NetFramework.2.1.3\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\packages\ComPDFKit.NetFramework.2.1.3\build\ComPDFKit.NetFramework.targets')" />
131128
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
132129
<PropertyGroup>
133-
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}</ErrorText>
130+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
134131
</PropertyGroup>
135-
<Error Condition="!Exists('..\packages\ComPDFKit.NetFramework.2.0.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ComPDFKit.NetFramework.2.0.0\build\ComPDFKit.NetFramework.targets'))" />
132+
<Error Condition="!Exists('..\packages\ComPDFKit.NetFramework.2.1.3\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ComPDFKit.NetFramework.2.1.3\build\ComPDFKit.NetFramework.targets'))" />
136133
</Target>
137134
</Project>

ComPDFKit for Windows/Examples/Annotations/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
<ToggleButton.Content>
149149
<Path Fill="#43474D" Width="30" Height="30">
150150
<Path.Data>
151-
M22.5 8.5H7.5V12.25H13H22.5V8.5ZM12.25 13.75H7.5V21.5H12.25V13.75ZM13.75 21.5V13.75H22.5V21.5H13.75ZM7.5 7H6V8.5V21.5V23H7.5H22.5H24V21.5V8.5V7H22.5H7.5Z
151+
M7.5 8.5H22.5V12.25H17H7.5V8.5ZM17.75 13.75H22.5V21.5H17.75V13.75ZM16.25 21.5V13.75H7.5V21.5H16.25ZM22.5 7H24V8.5V21.5V23H22.5H7.5H6V21.5V8.5V7H7.5H22.5Z
152152
</Path.Data>
153153
</Path>
154154
</ToggleButton.Content>

ComPDFKit for Windows/Examples/Annotations/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("2.0.0.0")]
55-
[assembly: AssemblyFileVersion("2.0.0.0")]
54+
[assembly: AssemblyVersion("2.1.3.0")]
55+
[assembly: AssemblyFileVersion("2.1.3.0")]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ComPDFKit.NetFramework" version="2.0.0" targetFramework="net461" />
3+
<package id="ComPDFKit.NetFramework" version="2.1.3" targetFramework="net461" />
44
<package id="PresentationFramework.Aero2" version="1.0.1" targetFramework="net461" />
55
</packages>

ComPDFKit for Windows/Examples/ComPDFKit.Tool/AlignmentsHelp.cs

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Linq;
5+
using System.Runtime.CompilerServices;
56
using System.Text;
67
using System.Threading.Tasks;
78
using System.Windows;
@@ -44,7 +45,7 @@ public static Point SetAlignLeft(Rect src, Rect dst)
4445
/// <returns>
4546
/// X Y direction distance required for alignment of the source rectangle
4647
/// </returns>
47-
public static Point SetAlignHorizonCenter (Rect src, Rect dst)
48+
public static Point SetAlignHorizonCenter(Rect src, Rect dst)
4849
{
4950
Point movePoint = new Point((dst.Left + dst.Right - src.Left - src.Right) / 2, 0);
5051
return movePoint;
@@ -214,6 +215,143 @@ public static Dictionary<Rect, Point> SetDistributeVertical(List<Rect> src, Rect
214215
return dictionary;
215216
}
216217

218+
/// <summary>
219+
/// Set the source rectangle to a horizontal distribution and align it within the target rectangle to maintain consistent gaps
220+
/// </summary>
221+
/// <param name="src">
222+
/// Array of source rectangles needed
223+
/// </param>
224+
/// <param name="dst">
225+
/// Target rectangle
226+
/// </param>
227+
/// <returns>
228+
/// Dictionary of XY direction distance required for alignment of each source rectangle
229+
/// </returns>
230+
public static Dictionary<Rect, Point> SetGapDistributeHorizontal(List<Rect> src, Rect dst)
231+
{
232+
Dictionary<Rect, Point> dictionary = new Dictionary<Rect, Point>();
233+
List<double> Leftlist = new List<double>();
234+
235+
// Sort the data according to the leftmost position of each rectangle, not the array order
236+
double weight = 0;
237+
foreach (Rect srcRect in src)
238+
{
239+
double left = srcRect.Left;
240+
if (Leftlist.Contains(left))
241+
{
242+
left += src.IndexOf(srcRect) * 0.01;
243+
}
244+
Leftlist.Add(left);
245+
weight += srcRect.Width;
246+
}
247+
double[] datalist = Leftlist.ToArray();
248+
Sort(datalist, 0, Leftlist.Count - 1);
249+
250+
double startX = dst.Left;
251+
double endX = dst.Right;
252+
double interval = ((endX - startX) - weight) / (Leftlist.Count - 1);
253+
for (int i = 0; i < datalist.Count(); i++)
254+
{
255+
int index = Leftlist.IndexOf(datalist[i]);
256+
Point movePoint = new Point();
257+
if (i == 0 || i == datalist.Count() - 1)
258+
{
259+
movePoint = new Point(0, 0);
260+
}
261+
else
262+
{
263+
double width = 0;
264+
for (int f = 0; f < i; f++)
265+
{
266+
int index2 = 0;
267+
if (f != 0)
268+
{
269+
index2 = Leftlist.IndexOf(datalist[i - 1]);
270+
width += src[index2].Width;
271+
}
272+
int index0 = Leftlist.IndexOf(datalist[0]);
273+
if (f == 0)
274+
{
275+
width += src[index0].Right;
276+
}
277+
width += interval;
278+
279+
}
280+
movePoint = new Point(width - src[index].X , 0);
281+
}
282+
dictionary.Add(src[index], movePoint);
283+
}
284+
return dictionary;
285+
}
286+
287+
/// <summary>
288+
/// Vertically distribute source rectangles within the target rectangle to maintain consistent gaps (sorted by the leftmost position of each rectangle, rather than array order)
289+
/// </summary>
290+
/// <param name="src">
291+
/// Array of source rectangles needed
292+
/// </param>
293+
/// <param name="dst">
294+
/// Target rectangle
295+
/// </param>
296+
/// <returns>
297+
/// Dictionary of XY direction distance required for alignment of each source rectangle
298+
/// </returns>
299+
public static Dictionary<Rect, Point> SetGapDistributeVertical(List<Rect> src, Rect dst)
300+
{
301+
Dictionary<Rect, Point> dictionary = new Dictionary<Rect, Point>();
302+
List<double> Leftlist = new List<double>();
303+
304+
// Sort the data according to the leftmost position of each rectangle, not the array order
305+
double tall = 0;
306+
foreach (Rect srcRect in src)
307+
{
308+
double top = srcRect.Top;
309+
if (Leftlist.Contains(top)) {
310+
top += src.IndexOf(srcRect)*0.01;
311+
}
312+
Leftlist.Add(top);
313+
tall += srcRect.Height;
314+
}
315+
double[] datalist = Leftlist.ToArray();
316+
Sort(datalist, 0, Leftlist.Count - 1);
317+
318+
double startY = dst.Top;
319+
double endY = dst.Bottom;
320+
double interval = ((endY - startY) - tall) / (Leftlist.Count - 1);
321+
for (int i = 0; i < datalist.Count(); i++)
322+
{
323+
int index = Leftlist.IndexOf(datalist[i]);
324+
Point movePoint = new Point();
325+
if (i == 0 || i == datalist.Count() - 1)
326+
{
327+
movePoint = new Point(0, 0);
328+
}
329+
else
330+
{
331+
double height = 0;
332+
for (int f = 0; f < i; f++)
333+
{
334+
int index2 = 0;
335+
if (f != 0)
336+
{
337+
index2 = Leftlist.IndexOf(datalist[i - 1]);
338+
height += src[index2].Height;
339+
}
340+
int index0 = Leftlist.IndexOf(datalist[0]);
341+
if (f == 0)
342+
{
343+
height += src[index0].Bottom;
344+
}
345+
height +=interval;
346+
347+
}
348+
movePoint = new Point(0, height - src[index].Y);
349+
}
350+
dictionary.Add(src[index], movePoint);
351+
}
352+
return dictionary;
353+
}
354+
217355
#region Quick sort
218356

219357
private static int SortUnit(double[] array, int low, int high)

0 commit comments

Comments
 (0)