diff --git a/PDFQFZ/FodyWeavers.xml b/PDFQFZ/FodyWeavers.xml new file mode 100644 index 0000000..5029e70 --- /dev/null +++ b/PDFQFZ/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PDFQFZ/FodyWeavers.xsd b/PDFQFZ/FodyWeavers.xsd new file mode 100644 index 0000000..05e92c1 --- /dev/null +++ b/PDFQFZ/FodyWeavers.xsd @@ -0,0 +1,141 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/PDFQFZ/Form1.Designer.cs b/PDFQFZ/Form1.Designer.cs index dd73050..c3582b2 100644 --- a/PDFQFZ/Form1.Designer.cs +++ b/PDFQFZ/Form1.Designer.cs @@ -614,7 +614,7 @@ private void InitializeComponent() this.textDpi.Name = "textDpi"; this.textDpi.Size = new System.Drawing.Size(43, 26); this.textDpi.TabIndex = 55; - this.textDpi.Text = "72"; + this.textDpi.Text = "150"; // // label5 // @@ -685,7 +685,7 @@ private void InitializeComponent() this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "Form1"; - this.Text = "PDF加盖骑缝章(V1.25)"; + this.Text = "PDF加盖骑缝章(V1.26)"; this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); diff --git a/PDFQFZ/Form1.cs b/PDFQFZ/Form1.cs index 259f128..1fa19b3 100644 --- a/PDFQFZ/Form1.cs +++ b/PDFQFZ/Form1.cs @@ -11,9 +11,7 @@ using System.Collections.Generic; using iTextSharp.text; using iTextSharp.text.exceptions; -using Org.BouncyCastle.Crypto.Generators; using PDFQFZ.Library; -using System.Text; using System.Threading.Tasks; namespace PDFQFZ @@ -36,21 +34,8 @@ public partial class Form1 : Form private string strIniFilePath = $@"{Application.StartupPath}\config.ini";//获取INI文件路径 - System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)//把DLL打包到EXE需要用到 - { - // 执行解析逻辑,加载所需的程序集 - string dllName = args.Name.Contains(",") ? args.Name.Substring(0, args.Name.IndexOf(',')) : args.Name.Replace(".dll", ""); - dllName = dllName.Replace(".", "_"); - if (dllName.EndsWith("_resources")) return null; - System.Resources.ResourceManager rm = new System.Resources.ResourceManager(GetType().Namespace + ".Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly()); - byte[] bytes = (byte[])rm.GetObject(dllName); - return System.Reflection.Assembly.Load(bytes); - } public Form1(string[] args) { - //在InitializeComponent()之前调用 - - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); InitializeComponent(); // 在这里处理命令行参数 if (args.Length > 0) @@ -1197,7 +1182,7 @@ public void PDFToiPDF(string pdfPath) //原版方法2 PDFFile pdfFile = PDFFile.Open(pdfPath); Bitmap[] bitmaps = new Bitmap[pdfFile.PageCount]; - int dpi = 300; //原版方法最好默认300 + int dpi = 200; //原版方法最好默认300 for (int i = 0; i < pdfFile.PageCount; i++) { Bitmap pageImage = pdfFile.GetPageImage(i, dpi); //这个地方转换导致原有水印和背景透明度丢失,下面的方法解决 diff --git a/PDFQFZ/PDFQFZ.csproj b/PDFQFZ/PDFQFZ.csproj index ef7eeff..47ad07c 100644 --- a/PDFQFZ/PDFQFZ.csproj +++ b/PDFQFZ/PDFQFZ.csproj @@ -74,20 +74,13 @@ PDFQFZ.Program - - D:\Downloads\O2S.Components.PDFRender4NET.dll + + False + D:\Downloads\428a8-main\O2S.Components.PDFRender4NET.dll - - - - - - - - @@ -100,8 +93,6 @@ - - Form1.cs Designer @@ -145,6 +136,11 @@ + + 5.7.0 + runtime;compile;build; native; contentfiles; analyzers; buildtransitive + all + 5.5.13.1 diff --git a/PDFQFZ/Properties/Resources.Designer.cs b/PDFQFZ/Properties/Resources.Designer.cs index 53cfa46..5325c6c 100644 --- a/PDFQFZ/Properties/Resources.Designer.cs +++ b/PDFQFZ/Properties/Resources.Designer.cs @@ -59,25 +59,5 @@ internal Resources() { resourceCulture = value; } } - - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] itextsharp { - get { - object obj = ResourceManager.GetObject("itextsharp", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] O2S_Components_PDFRender4NET { - get { - object obj = ResourceManager.GetObject("O2S_Components_PDFRender4NET", resourceCulture); - return ((byte[])(obj)); - } - } } } diff --git a/PDFQFZ/Properties/Resources.resx b/PDFQFZ/Properties/Resources.resx index fe7b515..2f96abe 100644 --- a/PDFQFZ/Properties/Resources.resx +++ b/PDFQFZ/Properties/Resources.resx @@ -118,10 +118,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\itextsharp.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\O2S.Components.PDFRender4NET.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - \ No newline at end of file diff --git a/PDFQFZ/Resources/O2S.Components.PDFRender4NET.dll b/PDFQFZ/Resources/O2S.Components.PDFRender4NET.dll deleted file mode 100644 index 5051fd6..0000000 Binary files a/PDFQFZ/Resources/O2S.Components.PDFRender4NET.dll and /dev/null differ diff --git a/PDFQFZ/Resources/itextsharp.dll b/PDFQFZ/Resources/itextsharp.dll deleted file mode 100644 index 9d4e5d8..0000000 Binary files a/PDFQFZ/Resources/itextsharp.dll and /dev/null differ diff --git a/pdfqfz.jpg b/pdfqfz.jpg index 0bfbcbe..0112d40 100644 Binary files a/pdfqfz.jpg and b/pdfqfz.jpg differ