功夫小子 发表于 2024-6-19 22:29

业余的人玩不转呀,有没有完整的例子呀

办公魔盒 发表于 2024-6-27 14:55

成功了 谢谢 楼主{:5_117:}

妹说就是林卡 发表于 2024-6-27 15:48

首先感谢下大佬分享。
我在使用过程中,出现第一次调用时仍有水印,第二次调用则不影响,一开始我用的是自己找到的license,我以为是哪里没改好,比如我的证书是20220516的,改了一通还是不能解决,后面看了所有的楼,找到了大佬分享的license,使用原本的代码第一次调用仍有水印,虽然不是很影响使用,我多调用一次就没问题了,但还是想知道,自己哪里做错了。以下是我的代码
private string DocConvertToPdf(string filePath)
    {
      InitHook();
      var doc = new Aspose.Words.Document(filePath);
      new License().SetLicense(new MemoryStream(Convert.FromBase64String(LICENSE_STRING)));
      // 不太清楚为什么hook第一次没有成功,但执行第二次就成功了,此处多运行一次
      doc.Save(tmpPdfFileName, Aspose.Words.SaveFormat.Pdf);
      doc.Save(tmpPdfFileName, Aspose.Words.SaveFormat.Pdf);
      return tmpPdfFileName;
    }

妹说就是林卡 发表于 2024-6-27 15:53

妹说就是林卡 发表于 2024-6-27 15:48
首先感谢下大佬分享。
我在使用过程中,出现第一次调用时仍有水印,第二次调用则不影响,一开始我用的是自 ...

自己回复一下,如果有跟我一样的问题出现,调换SetLicense和new Document的顺序即可,即:
private string DocConvertToPdf(string filePath)
    {
      InitHook();
      new License().SetLicense(new MemoryStream(Convert.FromBase64String(LICENSE_STRING)));
      var doc = new Aspose.Words.Document(filePath);
      // 不太清楚为什么hook第一次没有成功,但执行第二次就成功了,此处多运行一次
      doc.Save(tmpPdfFileName, Aspose.Words.SaveFormat.Pdf);
      //doc.Save(tmpPdfFileName, Aspose.Words.SaveFormat.Pdf);
      return tmpPdfFileName;
    }

壹佰 发表于 2024-6-28 11:21

很难学会 发表于 2024-6-28 15:18

{:6_225:}, 才知道老版教程过时了,Method Hook 完全看不懂了

宫宫宫郎 发表于 2024-6-28 23:57

太牛了 亲测有效{:5_121:}

天天顶不住 发表于 2024-7-2 16:42

感谢分享

约瑟夫 发表于 2024-7-5 09:47

本帖最后由 约瑟夫 于 2024-7-5 11:18 编辑

在微服务里调用 第一次导出完美 第二次则提示 权限不足 然后时间到期的提示
"权限错误:The subscription included in this license allows free upgrades until 27 Aug 2020, but this version of the product was released on 01 May 2024. Please renew the subscription or use a previous version of the product."
解决办法:
加入Hook标识已解决. 感谢大佬分享.

壹佰 发表于 2024-7-5 09:52

页: 1 2 3 4 5 [6] 7 8 9 10 11 12
查看完整版本: 【重磅】Aspose全家桶永久去限制全攻略(支持.NET 4x/6/8)