楼上说得对
从NuGet\Install-Package IronPdf -Version 2024.7.8下载了看确实是那玩意
这个版本的话,你截图的这里是这样的
我弄的话是这样弄
[C#] 纯文本查看 复制代码 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using IronPdf;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
try
{
Harmony _pluginTriggers = Harmony.CreateAndPatchAll(typeof(Triggers));
var key = "IRONPDF.INGENIUMPLUS.IRO220908.4745.54126.809022-EB0AD2DDFD-POXPZEJ33R5VA-74MSBPHQEDFV-RL2B47SAIDP4-5TS3TK5UV2Y2-766DUXYT2ZH5-ZG2AVJ-LJOLLXZR6BKKUA-LITE.SUB-WDNXKT.RENEW.SUPPORT.08.SEP.2023";
bool b = IronPdf.License.IsValidLicense(key);
Console.WriteLine(b);
IronPdf.License.LicenseKey = key;
var renderer = new ChromePdfRenderer(); // Instantiates Chrome Renderer
var pdf = renderer.RenderHtmlAsPdf(" <h1> ~Hello World~ </h1> Made with IronPDF!");
pdf.SaveAs("html_saved.pdf"); // Saves our PdfDocument object as a PDF
}
catch (Exception ex) {
Console.WriteLine(ex);
}
Console.ReadKey();
}
private class Triggers
{
[HarmonyPostfix]
[HarmonyPatch("Iron.Pdf.Extensions.ideosr", "rjokub")]
[HarmonyPatch("Iron.Pdf.Extensions.idepao", "laemxu")]
static public void GetStatusGrowUpData_Hook(ref bool __result)
{
__result = true;
}
}
}
}
找了个失效的key,然后把两个地方返回true
能不能用的话不知道,反正是跑起来了 |