From 500512434474d9c31b299ec39b205a8f8146f2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 17:20:54 +0800 Subject: [PATCH 01/11] =?UTF-8?q?csproj=E7=8E=B0=E4=BB=A3=E5=8C=96?= =?UTF-8?q?=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/PDFPatcher.csproj | 1123 +++-------------------------------------- App/packages.config | 6 - 2 files changed, 71 insertions(+), 1058 deletions(-) delete mode 100644 App/packages.config diff --git a/App/PDFPatcher.csproj b/App/PDFPatcher.csproj index f146476e..986e3d83 100644 --- a/App/PDFPatcher.csproj +++ b/App/PDFPatcher.csproj @@ -1,1054 +1,73 @@  - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {77A9FBD2-FB25-4590-864A-64A01A8724C4} - WinExe - Properties - PDFPatcher - PDFPatcher - v4.0 - 512 - pdf_icon.ico - true - true - wmjordan.snk - PDFPatcher.Program - OnOutputUpdated - - - - - true - ..\bin\Debug\ - TRACE;DEBUG;NET40;SOURCE_INCLUDE - true - full - x86 - prompt - false - latest - - - ..\bin\Release\ - TRACE;NET40;SOURCE_INCLUDE - true - true - pdbonly - x86 - false - prompt - latest - - - Common\app.manifest - - - - Lib\ColorPicker.dll - - - ..\packages\CyotekImageBox.1.3.0\lib\net20\Cyotek.Windows.Forms.ImageBox.dll - - - Lib\FreeImageNET.dll - - - Lib\HtmlRenderer.dll - - - Lib\HtmlRenderer.WinForms.dll - - - Lib\itextAsian.dll - - - Lib\itextsharp.dll - - - ..\packages\ObjectListView.Official.2.9.1\lib\net20\ObjectListView.dll - - - Lib\PowerJson.dll - - - - - - - - Lib\TradeWright.TabControlExtra.dll - - - - - True - True - ChineseCharMap.resx - - - - - - - - - - - - - - - - Form - - - FontCharSubstitutionForm.cs - - - Form - - - AddBookmarkConditionForm.cs - - - - - - - - - - - - - - - - - - - - - - - Form - - - PagePropertyForm.cs - - - - - - - Component - - - - - - - - - Form - - - CustomizeToolbarForm.cs - - - Form - - - Form - - - AutoBookmarkForm.cs - - - Form - - - DocumentInfoForm.cs - - - Form - - - InsertPageLabelForm.cs - - - - - - UserControl - - - - - - - - - - - - - - Component - - - Form - - - InsertBookmarkForm.cs - - - Component - - - - UserControl - - - FrontPageControl.cs - - - Form - - - DocumentFontListForm.cs - - - Form - - - AddPdfObjectForm.cs - - - Form - - - EditAdjustmentForm.cs - - - Form - - - FontFilterForm.cs - - - UserControl - - - FontNameConditionEditor.cs - - - UserControl - - - PageSettingsEditor.cs - - - UserControl - - - FontSubstitutionsEditor.cs - - - UserControl - - - Form - - - ImageViewerForm.cs - - - Form - - - SavePdfForm.cs - - - Form - - - MergerOptionForm.cs - - - UserControl - - - InfoExchangerControl.cs - - - - UserControl - - - RenameControl.cs - - - Component - - - UserControl - - - TextSizeConditionEditor.cs - - - - - - UserControl - - - OcrControl.cs - - - UserControl - - - PageRangeConditionEditor.cs - - - UserControl - - - TextConditionEditor.cs - - - UserControl - - - DocumentInspectorControl.cs - - - UserControl - - - TextPositionConditionEditor.cs - - - Form - - - TextViewerForm.cs - - - UserControl - - - RenderImageControl.cs - - - UserControl - - - MergerControl.cs - - - Form - - - SourcePdfOptionForm.cs - - - Form - - - UpdateForm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - ActionEditorForm.cs - - - Component - - - BookmarkEditorView.cs - - - UserControl - - - EditorControl.cs - - - UserControl - - - DocumentInfoEditor.cs - - - Component - - - Component - - - Form - - - NewCoordinateEntryForm.cs - - - UserControl - - - PageLabelEditor.cs - - - Form - - - RenamePreviewForm.cs - - - Component - - - Form - - - SearchBookmarkForm.cs - - - Form - - - ShiftPageNumberEntryForm.cs - - - UserControl - - - ExtractImageControl.cs - - - Form - - - SourceImageOptionForm.cs - - - Form - - - AppOptionForm.cs - - - UserControl - - - ViewerPreferenceEditor.cs - - - UserControl - - - AutoBookmarkControl.cs - - - Form - - - ZoomRateEntryForm.cs - - - Form - - - MainForm.cs - - - - - - - - - - - - - - - - - - - - Code - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - - - Code - - - - - - - - - - UserControl - - - AboutControl.cs - - - - UserControl - - - BookmarkControl.cs - - - Form - - - PatcherOptionForm.cs - - - - UserControl - - - TargetFileControl.cs - - - UserControl - - - PatcherControl.cs - - - - - - - - - - True - True - Resources.resx - - - - - - - - - Form - - - InfoFileOptionControl.cs - - - - - Form - - - PasswordEntryForm.cs - - - - - - - - - ResXFileCodeGenerator - ChineseCharMap.Designer.cs - - - - FontCharSubstitutionForm.cs - - - AddBookmarkConditionForm.cs - - - AutoBookmarkForm.cs - - - DocumentInfoForm.cs - - - InsertBookmarkForm.cs - - - CustomizeToolbarForm.cs - - - InsertPageLabelForm.cs - - - PagePropertyForm.cs - - - FrontPageControl.cs - Designer - - - AboutControl.cs - Designer - - - ActionEditorForm.cs - - - BookmarkEditorView.cs - - - EditorControl.cs - - - DocumentInfoEditor.cs - - - EditAdjustmentForm.cs - - - InfoFileOptionControl.cs - Designer - - - InfoExchangerControl.cs - - - RenameControl.cs - - - PatcherControl.cs - - - BookmarkControl.cs - Designer - - - PatcherOptionForm.cs - - - FontFilterForm.cs - - - FontNameConditionEditor.cs - - - ImageViewerForm.cs - - - SavePdfForm.cs - - - TextSizeConditionEditor.cs - - - NewCoordinateEntryForm.cs - - - PageLabelEditor.cs - - - RenamePreviewForm.cs - - - SearchBookmarkForm.cs - - - ShiftPageNumberEntryForm.cs - - - TargetFileControl.cs - Designer - - - ExtractImageControl.cs - Designer - - - SourceImageOptionForm.cs - - - AppOptionForm.cs - Designer - - - ViewerPreferenceEditor.cs - - - AutoBookmarkControl.cs - Designer - - - PasswordEntryForm.cs - Designer - - - ZoomRateEntryForm.cs - - - OcrControl.cs - Designer - - - PageRangeConditionEditor.cs - - - TextConditionEditor.cs - - - DocumentInspectorControl.cs - - - MainForm.cs - Designer - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - SourceFileControl.cs - Designer - - - ExtractPageControl.cs - Designer - - - ReportControl.cs - Designer - - - - UserControl - - - SourceFileControl.cs - - - UserControl - - - ExtractPageControl.cs - - - - UserControl - - - ReportControl.cs - - - - - PreserveNewest - - - PreserveNewest - - - - - Designer - - - Designer - - - - - - - - - DocumentFontListForm.cs - - - AddPdfObjectForm.cs - - - PageSettingsEditor.cs - - - FontSubstitutionsEditor.cs - - - MergerOptionForm.cs - - - TextPositionConditionEditor.cs - - - TextViewerForm.cs - - - RenderImageControl.cs - Designer - - - MergerControl.cs - - - SourcePdfOptionForm.cs - - - UpdateForm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 此项目引用这台计算机上缺少的 NuGet 程序包。使用 NuGet 程序包还原可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - - - - - - - - - - + + + 9.0.30729 + 2.0 + {77A9FBD2-FB25-4590-864A-64A01A8724C4} + WinExe + Properties + PDFPatcher + PDFPatcher + pdf_icon.ico + true + PDFPatcher.Program + net6.0 + x86 + true + true + true + $(DefineConstants);SOURCE_INCLUDE + Common\app.manifest + enable + ..\bin + + wmjordan.snk + true + + + + + Lib\ColorPicker.dll + + + Lib\FreeImageNET.dll + + + Lib\HtmlRenderer.dll + + + Lib\HtmlRenderer.WinForms.dll + + + Lib\itextAsian.dll + + + Lib\itextsharp.dll + + + Lib\PowerJson.dll + + + Lib\TradeWright.TabControlExtra.dll + + + + + PreserveNewest + + + PreserveNewest + + + + + Designer + + + Designer + + + + + \ No newline at end of file diff --git a/App/packages.config b/App/packages.config deleted file mode 100644 index 61e67767..00000000 --- a/App/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 78f97bfce0227a7f7c5dfa9c38f393cf86637081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 18:34:01 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E5=88=A0=E9=99=A4CAS=E7=89=B9=E6=80=A7=E3=80=82=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4AssemblyInfo=EF=BC=8C=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=94=9F=E6=88=90=E7=9A=84AssemblyInfo=E3=80=82=20?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=BF=BD=E7=95=A5Mupdf\DataModel.cs=E5=92=8C?= =?UTF-8?q?ImageDeskerProcessor.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Common/DualKeyDictionary.cs | 2 ++ App/Common/FilePath.cs | 2 +- App/Common/FontUtility.cs | 6 ++-- App/Common/PInvokeHelper.cs | 4 ++- App/Functions/AboutControl.cs | 2 +- App/Functions/DocumentInspectorControl.cs | 3 -- App/Functions/EditorControl.cs | 1 - App/Functions/MergerControl.cs | 3 +- App/Model/ColorSpaces/CIELab.cs | 2 +- App/Model/ColorSpaces/CIEXYZ.cs | 2 +- App/Model/ColorSpaces/CMYK.cs | 2 +- App/Model/ColorSpaces/HSB.cs | 2 +- App/Model/ColorSpaces/HSL.cs | 2 +- App/Model/ColorSpaces/RGB.cs | 2 +- App/Model/ColorSpaces/YUV.cs | 2 +- App/PDFPatcher.csproj | 26 +++++++++++--- App/Processor/Mupdf/Interop.cs | 2 +- App/Processor/Mupdf/MuHandle.cs | 41 +++++++++-------------- App/Processor/Mupdf/NativeMethods.cs | 2 +- App/Processor/NullXmlWriter.cs | 2 +- App/Properties/AssemblyInfo.cs | 26 -------------- 21 files changed, 59 insertions(+), 77 deletions(-) delete mode 100644 App/Properties/AssemblyInfo.cs diff --git a/App/Common/DualKeyDictionary.cs b/App/Common/DualKeyDictionary.cs index b4e7a399..9f632d6b 100644 --- a/App/Common/DualKeyDictionary.cs +++ b/App/Common/DualKeyDictionary.cs @@ -4,6 +4,8 @@ namespace PDFPatcher.Common { public class DualKeyDictionary : IDictionary + where K : notnull + where V : notnull { private readonly Dictionary _keyDictionary = new Dictionary(); private readonly Dictionary _reverseDictionary = new Dictionary(); diff --git a/App/Common/FilePath.cs b/App/Common/FilePath.cs index 4b6705b3..407646ba 100644 --- a/App/Common/FilePath.cs +++ b/App/Common/FilePath.cs @@ -1097,7 +1097,7 @@ namespace PDFPatcher.Common /// 需要与当前实例比较的对象。 /// 在两个文件路径相等时,返回 true。 [DebuggerStepThrough] - public override bool Equals(object obj) { + public override bool Equals(object? obj) { return obj is FilePath && Equals((FilePath)obj); } diff --git a/App/Common/FontUtility.cs b/App/Common/FontUtility.cs index 64d7266f..fb3bce95 100644 --- a/App/Common/FontUtility.cs +++ b/App/Common/FontUtility.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Text; using System.Text.RegularExpressions; @@ -10,7 +11,7 @@ static class FontUtility static readonly Regex _italic = new Regex(" (?:Italic|Oblique)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); static readonly Regex _bold = new Regex(" Bold$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); static readonly Regex _boldItalic = new Regex(" Bold (?:Italic|Oblique)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - static FriendlyFontName[] _Fonts; + static FriendlyFontName[]? _Fonts; public static FriendlyFontName[] InstalledFonts { get { @@ -21,6 +22,7 @@ static class FontUtility } } + [MemberNotNull("_Fonts")] private static void ListInstalledFonts() { var uf = new List(); // 可能包含中文的字体 var of = new List(); // 其他字体 @@ -48,7 +50,7 @@ static class FontUtility internal struct FriendlyFontName : IComparable { public string OriginalName; - public string DisplayName; + public string? DisplayName; public FriendlyFontName(string originalName, string displayName) { OriginalName = originalName; DisplayName = displayName != originalName ? displayName : null; diff --git a/App/Common/PInvokeHelper.cs b/App/Common/PInvokeHelper.cs index f90dc0b4..b6dd0efb 100644 --- a/App/Common/PInvokeHelper.cs +++ b/App/Common/PInvokeHelper.cs @@ -18,6 +18,8 @@ static class PInvokeHelper return t; } - + internal static T UnwrapPointer(IntPtr p) { + throw new NotImplementedException(); + } } } diff --git a/App/Functions/AboutControl.cs b/App/Functions/AboutControl.cs index 6d042452..00d58138 100644 --- a/App/Functions/AboutControl.cs +++ b/App/Functions/AboutControl.cs @@ -37,7 +37,7 @@ sealed partial class AboutControl : Functions.HtmlPageControl return titleAttribute.Title; } } - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location); } } diff --git a/App/Functions/DocumentInspectorControl.cs b/App/Functions/DocumentInspectorControl.cs index 9793a26d..927af810 100644 --- a/App/Functions/DocumentInspectorControl.cs +++ b/App/Functions/DocumentInspectorControl.cs @@ -4,7 +4,6 @@ using System.Drawing; using System.IO; using System.Linq; -using System.Security.Permissions; using System.Windows.Forms; using System.Xml; using BrightIdeasSoftware; @@ -288,8 +287,6 @@ public sealed partial class DocumentInspectorControl : FunctionControl, IDocumen break; } } - - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (_ObjectDetailBox.IsCellEditing) { return base.ProcessCmdKey(ref msg, keyData); diff --git a/App/Functions/EditorControl.cs b/App/Functions/EditorControl.cs index c733674f..70cc5f29 100644 --- a/App/Functions/EditorControl.cs +++ b/App/Functions/EditorControl.cs @@ -475,7 +475,6 @@ public sealed partial class EditorControl : FunctionControl, IDocumentEditor, Ed ExecuteCommand(Commands.OpenFile, e.ClickedItem.ToolTipText); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (_BookmarkBox.IsCellEditing || _BookmarkBox.IsLabelEditing || _CurrentPageBox.Focused) { return base.ProcessCmdKey(ref msg, keyData); diff --git a/App/Functions/MergerControl.cs b/App/Functions/MergerControl.cs index 54fb6517..7da0db65 100644 --- a/App/Functions/MergerControl.cs +++ b/App/Functions/MergerControl.cs @@ -3,7 +3,6 @@ using System.ComponentModel; using System.Drawing; using System.Linq; -using System.Security.Permissions; using System.Text; using System.Windows.Forms; using BrightIdeasSoftware; @@ -121,7 +120,7 @@ public partial class MergerControl : FunctionControl }; } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (_ItemList.IsCellEditing || _ItemList.Focused == false) { return base.ProcessCmdKey(ref msg, keyData); diff --git a/App/Model/ColorSpaces/CIELab.cs b/App/Model/ColorSpaces/CIELab.cs index a87267e9..64264725 100644 --- a/App/Model/ColorSpaces/CIELab.cs +++ b/App/Model/ColorSpaces/CIELab.cs @@ -73,7 +73,7 @@ public struct CIELab } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (CIELab)obj); diff --git a/App/Model/ColorSpaces/CIEXYZ.cs b/App/Model/ColorSpaces/CIEXYZ.cs index 68d35170..300b1aee 100644 --- a/App/Model/ColorSpaces/CIEXYZ.cs +++ b/App/Model/ColorSpaces/CIEXYZ.cs @@ -77,7 +77,7 @@ public struct CIEXYZ } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (CIEXYZ)obj); diff --git a/App/Model/ColorSpaces/CMYK.cs b/App/Model/ColorSpaces/CMYK.cs index 1ac56e90..dfba27df 100644 --- a/App/Model/ColorSpaces/CMYK.cs +++ b/App/Model/ColorSpaces/CMYK.cs @@ -86,7 +86,7 @@ public struct CMYK } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (CMYK)obj); diff --git a/App/Model/ColorSpaces/HSB.cs b/App/Model/ColorSpaces/HSB.cs index 954d9c39..ec382ca2 100644 --- a/App/Model/ColorSpaces/HSB.cs +++ b/App/Model/ColorSpaces/HSB.cs @@ -80,7 +80,7 @@ public struct HSB } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (HSB)obj); diff --git a/App/Model/ColorSpaces/HSL.cs b/App/Model/ColorSpaces/HSL.cs index 73f3a0a8..91ee4337 100644 --- a/App/Model/ColorSpaces/HSL.cs +++ b/App/Model/ColorSpaces/HSL.cs @@ -81,7 +81,7 @@ public struct HSL } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (HSL)obj); diff --git a/App/Model/ColorSpaces/RGB.cs b/App/Model/ColorSpaces/RGB.cs index c82976a2..bc6aa275 100644 --- a/App/Model/ColorSpaces/RGB.cs +++ b/App/Model/ColorSpaces/RGB.cs @@ -66,7 +66,7 @@ public struct RGB } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (RGB)obj); diff --git a/App/Model/ColorSpaces/YUV.cs b/App/Model/ColorSpaces/YUV.cs index 78cbeb23..8ce81cd9 100644 --- a/App/Model/ColorSpaces/YUV.cs +++ b/App/Model/ColorSpaces/YUV.cs @@ -74,7 +74,7 @@ public struct YUV } #region Methods - public override bool Equals(Object obj) { + public override bool Equals(Object? obj) { if (obj == null || GetType() != obj.GetType()) return false; return (this == (YUV)obj); diff --git a/App/PDFPatcher.csproj b/App/PDFPatcher.csproj index 986e3d83..201a0107 100644 --- a/App/PDFPatcher.csproj +++ b/App/PDFPatcher.csproj @@ -1,5 +1,5 @@  - + 9.0.30729 2.0 @@ -11,21 +11,31 @@ pdf_icon.ico true PDFPatcher.Program - net6.0 - x86 + net6.0-windows + x86;x64 true - true + False true - $(DefineConstants);SOURCE_INCLUDE + $(DefineConstants);NET40;SOURCE_INCLUDE Common\app.manifest enable ..\bin + wmjordan.snk true + + + + + + + + + Lib\ColorPicker.dll @@ -66,8 +76,14 @@ Designer + + + + PreserveNewest + + \ No newline at end of file diff --git a/App/Processor/Mupdf/Interop.cs b/App/Processor/Mupdf/Interop.cs index f87c95a3..a3069faa 100644 --- a/App/Processor/Mupdf/Interop.cs +++ b/App/Processor/Mupdf/Interop.cs @@ -23,7 +23,7 @@ internal interface ILinkedList } internal static T MarshalAs(this IntPtr ptr) where T : struct { - return (T)Marshal.PtrToStructure(ptr, typeof(T)); + return (T)Marshal.PtrToStructure(ptr, typeof(T))!; } internal static bool IsValid(this SafeHandle handle) { diff --git a/App/Processor/Mupdf/MuHandle.cs b/App/Processor/Mupdf/MuHandle.cs index 223637ad..8d7bf8a7 100644 --- a/App/Processor/Mupdf/MuHandle.cs +++ b/App/Processor/Mupdf/MuHandle.cs @@ -4,8 +4,6 @@ namespace MuPdfSharp { - [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)] - [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)] abstract class MuHandle : System.Runtime.InteropServices.SafeHandle { protected MuHandle() : base(IntPtr.Zero, true) { } @@ -29,7 +27,6 @@ sealed class ContextHandle : MuHandle return NativeMethods.NewContext(); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] protected override bool ReleaseHandle() { NativeMethods.DropContext(handle); SetHandleAsInvalid(); @@ -65,13 +62,11 @@ sealed class DocumentHandle : MuHandle { readonly ContextHandle _context; readonly bool _releaseContext; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] internal DocumentHandle(ContextHandle context, StreamHandle stream) { handle = NativeMethods.OpenPdfDocumentStream(context, stream); _context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] internal DocumentHandle(ContextHandle context, IntPtr documentHandle) { handle = documentHandle; _context = context; @@ -80,7 +75,6 @@ sealed class DocumentHandle : MuHandle internal ContextHandle Context => _context; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] protected override bool ReleaseHandle() { NativeMethods.DropDocument(_context, handle); if (_releaseContext) { @@ -94,20 +88,17 @@ sealed class StreamHandle : MuHandle { readonly bool _releaseContext; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] internal StreamHandle(ContextHandle context, IntPtr handle) { this.handle = handle; Context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] internal StreamHandle(ContextHandle context, string filePath) : this(context, NativeMethods.OpenFile(context, filePath)) { } internal ContextHandle Context { get; } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] protected override bool ReleaseHandle() { NativeMethods.DropStream(Context, handle); if (_releaseContext) { @@ -132,23 +123,23 @@ sealed class DeviceHandle : MuHandle context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal DeviceHandle(ContextHandle context, ref Rectangle rectangle) : this(context, NativeMethods.NewBBoxDevice(context, ref rectangle)) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal DeviceHandle(ContextHandle context, PixmapHandle pixmap, Matrix matrix) : this(context, NativeMethods.NewDrawDevice(context, matrix, pixmap)) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal DeviceHandle(ContextHandle context, PixmapHandle pixmap, Matrix matrix, ref BBox box) : this(context, NativeMethods.NewDrawDevice(context, matrix, pixmap, ref box)) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal DeviceHandle(ContextHandle context, DisplayListHandle displayList) : this(context, NativeMethods.NewListDevice(context, displayList)) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal DeviceHandle(ContextHandle context, TextPageHandle page) : this(context, NativeMethods.NewTextDevice(context, page, null)) { } @@ -156,7 +147,7 @@ internal DeviceHandle(ContextHandle context, TextPageHandle page) NativeMethods.CloseDevice(_context, handle); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + protected override bool ReleaseHandle() { NativeMethods.DropDevice(_context, handle); if (_releaseContext) { @@ -170,7 +161,7 @@ sealed class PageHandle : MuHandle { readonly DocumentHandle _document; readonly bool _releaseDocument; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + public PageHandle(DocumentHandle document, int pageNumber) { handle = NativeMethods.LoadPage(document.Context, document, pageNumber); _document = document; @@ -179,7 +170,7 @@ sealed class PageHandle : MuHandle internal unsafe IntPtr PageDictionary => ((NativePage*)handle)->PageDictionary; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + protected override bool ReleaseHandle() { NativeMethods.DropPage(_document.Context, handle); if (_releaseDocument) { @@ -228,14 +219,14 @@ sealed class DisplayListHandle : MuHandle { readonly ContextHandle _context; readonly bool _releaseContext; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal DisplayListHandle(ContextHandle context, Rectangle mediaBox) { handle = NativeMethods.NewDisplayList(context, mediaBox); _context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + protected override bool ReleaseHandle() { NativeMethods.DropDisplayList(_context, handle); if (_releaseContext) { @@ -249,27 +240,27 @@ sealed class PixmapHandle : MuHandle { readonly ContextHandle _context; readonly bool _releaseContext; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal PixmapHandle(ContextHandle context, IntPtr pixmap) { handle = pixmap; _context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal PixmapHandle(ContextHandle context, IntPtr colorspace, int width, int height) { handle = NativeMethods.NewPixmap(context, colorspace, width, height, IntPtr.Zero, 0); _context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal PixmapHandle(ContextHandle context, IntPtr colorspace, BBox box) { handle = NativeMethods.NewPixmap(context, colorspace, box, IntPtr.Zero, 0); _context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + protected override bool ReleaseHandle() { NativeMethods.DropPixmap(_context, handle); if (_releaseContext) { @@ -283,14 +274,14 @@ sealed class TextPageHandle : MuHandle { readonly ContextHandle _context; readonly bool _releaseContext; - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + internal TextPageHandle(ContextHandle context, Rectangle mediaBox) { handle = NativeMethods.NewTextPage(context, mediaBox); _context = context; context.DangerousAddRef(ref _releaseContext); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.None)] + protected override bool ReleaseHandle() { NativeMethods.DropTextPage(_context, handle); if (_releaseContext) { diff --git a/App/Processor/Mupdf/NativeMethods.cs b/App/Processor/Mupdf/NativeMethods.cs index 62e448c8..befd9ed3 100644 --- a/App/Processor/Mupdf/NativeMethods.cs +++ b/App/Processor/Mupdf/NativeMethods.cs @@ -71,7 +71,7 @@ static partial class NativeMethods internal static extern IntPtr NewListDevice(ContextHandle ctx, DisplayListHandle list); [DllImport(DLL, CallingConvention = CC.Cdecl, EntryPoint = "fz_new_stext_device")] - internal static extern IntPtr NewTextDevice(ContextHandle ctx, TextPageHandle page, TextOptions options); + internal static extern IntPtr NewTextDevice(ContextHandle ctx, TextPageHandle page, TextOptions? options); [DllImport(DLL, CallingConvention = CC.Cdecl, EntryPoint = "fz_close_device")] internal static extern void CloseDevice(ContextHandle context, IntPtr dev); diff --git a/App/Processor/NullXmlWriter.cs b/App/Processor/NullXmlWriter.cs index d03de06f..9101a286 100644 --- a/App/Processor/NullXmlWriter.cs +++ b/App/Processor/NullXmlWriter.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; - +#nullable disable namespace PDFPatcher.Processor { sealed class NullXmlWriter : System.Xml.XmlWriter diff --git a/App/Properties/AssemblyInfo.cs b/App/Properties/AssemblyInfo.cs deleted file mode 100644 index 86fec431..00000000 --- a/App/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 有关程序集的常规信息通过下列属性集 -// 控制。更改这些属性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("PDFPatcher")] -[assembly: AssemblyDescription(PDFPatcher.Constants.AppName)] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("wmjordan@163.com")] -[assembly: AssemblyProduct(PDFPatcher.Constants.AppEngName)] -[assembly: AssemblyCopyright("著作权所有 © WMJordan 2009~2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 属性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("e8969c5f-a5fe-4dce-a08b-555686483732")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.3744")] From 847ded1296bf693cb43f37822cf5b04b5a9fe31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 18:34:28 +0800 Subject: [PATCH 03/11] =?UTF-8?q?WebClient=E6=94=B9=E7=94=A8HttpClient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Functions/UpdateForm.cs | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/App/Functions/UpdateForm.cs b/App/Functions/UpdateForm.cs index 218842bd..146e1109 100644 --- a/App/Functions/UpdateForm.cs +++ b/App/Functions/UpdateForm.cs @@ -3,15 +3,19 @@ using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; +using System.Net.Http; using System.Text; +using System.Threading.Tasks; using System.Windows.Forms; +using System.Xml; using PDFPatcher.Common; namespace PDFPatcher.Functions { public partial class UpdateForm : Form { - System.Net.WebClient _UpdateChecker; + HttpClient _UpdateChecker; public UpdateForm() { InitializeComponent(); @@ -30,7 +34,7 @@ public partial class UpdateForm : Form CommonCommands.VisitHomePage(); }; _DownloadButton.Click += (s, args) => { - System.Diagnostics.Process.Start(_DownloadButton.Tag.ToString()); + System.Diagnostics.Process.Start(_DownloadButton.Tag.ToString()!); }; _CheckUpdateIntervalBox.SelectedIndexChanged += (s, args) => { switch (_CheckUpdateIntervalBox.SelectedIndex) { @@ -46,27 +50,23 @@ public partial class UpdateForm : Form } private void CheckNewVersion() { - _UpdateChecker = new System.Net.WebClient(); _InfoBox.AppendLine("正在检查新版本,请稍候……"); - _UpdateChecker.DownloadDataCompleted += (s, args) => { - _InfoBox.Clear(); - if (args.Error != null) { - _InfoBox.AppendText("检查新版本失败:" + args.Error.Message); - goto Exit; - } + + Task.Run(async () => { + using HttpClient client = new(); try { - var x = new System.Xml.XmlDocument(); - x.Load(new System.IO.MemoryStream(args.Result)); - CheckResult(x); + Stream s = await client.GetStreamAsync(Constants.AppUpdateFile); + XmlDocument xdoc = new(); + xdoc.Load(s); + CheckResult(xdoc); } - catch (Exception) { - Common.FormHelper.ErrorBox("版本信息文件格式错误,请稍候重试。"); + catch (HttpRequestException e) { + _InfoBox.AppendText("检查新版本失败:" + e.Message); } - Exit: - _UpdateChecker.Dispose(); - _UpdateChecker = null; - }; - _UpdateChecker.DownloadDataAsync(new Uri(Constants.AppUpdateFile)); + catch (XmlException e) { + FormHelper.ErrorBox("版本信息文件格式错误,请稍候重试。"); + } + }); } private void CheckResult(System.Xml.XmlDocument x) { @@ -74,6 +74,7 @@ public partial class UpdateForm : Form if (r == null || r.Name != Constants.AppEngName) { _InfoBox.SelectionColor = Color.Red; _InfoBox.AppendLine("版本信息文件格式错误,请稍候重试。"); + return; } var v = r.GetAttribute("version"); var d = r.GetAttribute("date"); From 0bf9b14f024181d62ae823afe62683e5d763c15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 18:35:08 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=B0=86jbig2=E7=9A=84=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=9B=86=E5=8D=87=E7=BA=A7=E5=88=B0v143(VS?= =?UTF-8?q?=202022)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JBig2/jbig2.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/JBig2/jbig2.vcxproj b/JBig2/jbig2.vcxproj index 7bafea3d..1f09bfb2 100644 --- a/JBig2/jbig2.vcxproj +++ b/JBig2/jbig2.vcxproj @@ -79,25 +79,25 @@ DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 Application true - v142 + v143 Unicode Application false - v142 + v143 true Unicode From 9ff47552a7788705b4a873d005b37bc3770c4e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 18:35:38 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=88=A0=E9=99=A4AnyCPU=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PDFPatcher.sln | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/PDFPatcher.sln b/PDFPatcher.sln index 572ae762..e39680ab 100644 --- a/PDFPatcher.sln +++ b/PDFPatcher.sln @@ -1,14 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31829.152 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFPatcher", "App\PDFPatcher.csproj", "{77A9FBD2-FB25-4590-864A-64A01A8724C4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDFPatcher", "App\PDFPatcher.csproj", "{77A9FBD2-FB25-4590-864A-64A01A8724C4}" ProjectSection(ProjectDependencies) = postProject {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2} = {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "jbig2\jbig2.vcxproj", "{A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "JBig2\jbig2.vcxproj", "{A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3243E921-0EC3-44D1-96CC-C3E05BF9C89B}" ProjectSection(SolutionItems) = preProject @@ -18,38 +18,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Win32 = Release|Win32 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|Any CPU.ActiveCfg = Debug|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|Win32.ActiveCfg = Debug|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|Win32.Build.0 = Debug|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|x64.ActiveCfg = Debug|x86 + {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|x64.ActiveCfg = Debug|x64 + {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|x64.Build.0 = Debug|x64 {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|x86.ActiveCfg = Debug|x86 {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Debug|x86.Build.0 = Debug|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|Any CPU.ActiveCfg = Release|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|Win32.ActiveCfg = Release|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|Win32.Build.0 = Release|x86 - {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|x64.ActiveCfg = Release|x86 + {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|x64.ActiveCfg = Release|x64 + {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|x64.Build.0 = Release|x64 {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|x86.ActiveCfg = Release|x86 {77A9FBD2-FB25-4590-864A-64A01A8724C4}.Release|x86.Build.0 = Release|x86 - {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|Win32.ActiveCfg = Debug|Win32 - {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|Win32.Build.0 = Debug|Win32 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|x64.ActiveCfg = Debug|x64 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|x64.Build.0 = Debug|x64 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|x86.ActiveCfg = Debug|Win32 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Debug|x86.Build.0 = Debug|Win32 - {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Release|Any CPU.ActiveCfg = Release|Win32 - {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Release|Win32.ActiveCfg = Release|Win32 - {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Release|Win32.Build.0 = Release|Win32 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Release|x64.ActiveCfg = Release|x64 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Release|x64.Build.0 = Release|x64 {A8C76A16-25E3-45B6-B974-4F4CB88E5AE2}.Release|x86.ActiveCfg = Release|Win32 From 8a29cbc23ba914db67f9aec213b5dfa82c44acd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 19:58:32 +0800 Subject: [PATCH 06/11] =?UTF-8?q?jbig2=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B7=A5=E5=85=B7=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JBig2/jbig2.vcxproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/JBig2/jbig2.vcxproj b/JBig2/jbig2.vcxproj index 1f09bfb2..fa4f9f6a 100644 --- a/JBig2/jbig2.vcxproj +++ b/JBig2/jbig2.vcxproj @@ -79,25 +79,21 @@ DynamicLibrary true Unicode - v143 DynamicLibrary false true Unicode - v143 Application true - v143 Unicode Application false - v143 true Unicode From 099ffcc55827b868b760e0c260d8fcb01d59762e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 20:00:04 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8E=BB=E6=8E=89ILRepacker=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E7=94=A8SDK=E8=87=AA=E5=B8=A6=E5=89=AA=E8=A3=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/PDFPatcher.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App/PDFPatcher.csproj b/App/PDFPatcher.csproj index 201a0107..5f1ef029 100644 --- a/App/PDFPatcher.csproj +++ b/App/PDFPatcher.csproj @@ -20,7 +20,8 @@ Common\app.manifest enable ..\bin - + + true wmjordan.snk true @@ -34,7 +35,6 @@ - Lib\ColorPicker.dll From 597f0ec369473c2a8923e20331893d3d8410ac2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 21:02:34 +0800 Subject: [PATCH 08/11] =?UTF-8?q?jbig2=E8=87=AA=E8=A1=8C=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=B9=B6=E4=BD=BF=E7=94=A8=E6=9C=80=E9=AB=98=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=9B=86=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JBig2/DetectHighestPlatformToolset.props | 7 + JBig2/jbig2.vcxproj | 397 ++++++++++++----------- 2 files changed, 206 insertions(+), 198 deletions(-) create mode 100644 JBig2/DetectHighestPlatformToolset.props diff --git a/JBig2/DetectHighestPlatformToolset.props b/JBig2/DetectHighestPlatformToolset.props new file mode 100644 index 00000000..339519c4 --- /dev/null +++ b/JBig2/DetectHighestPlatformToolset.props @@ -0,0 +1,7 @@ + + + + v142 + v143 + + diff --git a/JBig2/jbig2.vcxproj b/JBig2/jbig2.vcxproj index fa4f9f6a..3a9205f5 100644 --- a/JBig2/jbig2.vcxproj +++ b/JBig2/jbig2.vcxproj @@ -1,201 +1,202 @@ - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 16.0 - Win32Proj - {a8c76a16-25e3-45b6-b974-4f4cb88e5ae2} - jbig2 - 10.0 - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(ProjectDir)include;$(IncludePath) - $(SolutionDir)bin\$(Configuration)\ - obj\$(Configuration)\ - - - false - $(ProjectDir)include;$(IncludePath) - $(SolutionDir)bin\$(Configuration)\ - obj\$(Configuration)\ - - - true - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - false - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - Level3 - true - WIN32;__STDC_LIMIT_MACROS;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - jbig2.def - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - WIN32;__STDC_LIMIT_MACROS;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - jbig2.def - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16.0 + Win32Proj + {a8c76a16-25e3-45b6-b974-4f4cb88e5ae2} + jbig2 + 10.0 + + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)include;$(IncludePath) + $(SolutionDir)bin\$(Configuration)\ + obj\$(Configuration)\ + + + false + $(ProjectDir)include;$(IncludePath) + $(SolutionDir)bin\$(Configuration)\ + obj\$(Configuration)\ + + + true + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + + + + Level3 + true + WIN32;__STDC_LIMIT_MACROS;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + jbig2.def + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + WIN32;__STDC_LIMIT_MACROS;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + jbig2.def + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + \ No newline at end of file From 5d3189ac5743ee8fe559249450e6a34fa2892254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 21:03:31 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=89=AA=E8=A3=81?= =?UTF-8?q?=EF=BC=8C=E9=99=8D=E7=BA=A7=E5=88=B0net5.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/PDFPatcher.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/PDFPatcher.csproj b/App/PDFPatcher.csproj index 5f1ef029..3d21a414 100644 --- a/App/PDFPatcher.csproj +++ b/App/PDFPatcher.csproj @@ -11,7 +11,7 @@ pdf_icon.ico true PDFPatcher.Program - net6.0-windows + net5.0 x86;x64 true False From 7085c47858709f5b712127f7333d1eda62d34056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Fri, 7 Jan 2022 21:15:01 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=88=9A=E5=88=9A=E6=B2=A1=E5=85=B3?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/PDFPatcher.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/PDFPatcher.csproj b/App/PDFPatcher.csproj index 3d21a414..43d6bfc4 100644 --- a/App/PDFPatcher.csproj +++ b/App/PDFPatcher.csproj @@ -21,7 +21,7 @@ enable ..\bin - true + false wmjordan.snk true From 9737a0e6b1a4729853921fafa6f874071bc58701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <1207247008@qq.com> Date: Sat, 8 Jan 2022 12:37:30 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublishProfiles/FxDependent.pubxml | 17 +++++++++++++++++ .../PublishProfiles/Independent.pubxml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 App/Properties/PublishProfiles/FxDependent.pubxml create mode 100644 App/Properties/PublishProfiles/Independent.pubxml diff --git a/App/Properties/PublishProfiles/FxDependent.pubxml b/App/Properties/PublishProfiles/FxDependent.pubxml new file mode 100644 index 00000000..96961249 --- /dev/null +++ b/App/Properties/PublishProfiles/FxDependent.pubxml @@ -0,0 +1,17 @@ + + + + + Release + x86 + ..\bin\publish\fx-dependent-x86 + FileSystem + net5.0-windows + false + win-x86 + False + False + + \ No newline at end of file diff --git a/App/Properties/PublishProfiles/Independent.pubxml b/App/Properties/PublishProfiles/Independent.pubxml new file mode 100644 index 00000000..c3e144c0 --- /dev/null +++ b/App/Properties/PublishProfiles/Independent.pubxml @@ -0,0 +1,17 @@ + + + + + Release + x86 + ..\bin\publish\win-x86\ + FileSystem + net5.0-windows + win-x86 + true + False + False + + \ No newline at end of file