找回密码
 立即注册

QQ登录

只需一步,快速开始

文刀

注册会员

2

主题

6

帖子

22

积分

注册会员

积分
22

微信认证勋章

最新发帖
文刀
注册会员   /  发表于:2016-11-30 17:58  /   查看:4000  /  回复:6
如题
这个方法不对吗?
可不可以给个小栗子?

6 个回复

倒序浏览
gw0506
超级版主   /  发表于:2016-11-30 19:22:20
沙发
你好歹给我个代码以及错误截图让俺看看吧~  你是在考我啊~~哈哈
感觉是没有添加PDF模块。
你别问我添加什么模块哈,我的看到你的代码,例子,知道你想干啥,才能判断要怎么处理。
回复 使用道具 举报
文刀
注册会员   /  发表于:2016-11-30 19:51:14
板凳
string fileName1 = @"C:\File1.pdf"; string fileName2 = @"C:\File2.pdf"; string fileName3 = @"C:\File3.pdf"; string finalFileName = @"C:\Final.pdf"; // Load first file PDFFile file = new PDFFile(fileName1); // Merge with second and third files, put the result in final file.MergeWith(new string[] { fileName2, fileName3 }, finalFileName); // Convert final file to PDF/A file = new PDFFile(finalFileName); file.ConvertToPDFA(null);   您好!我参照的是这段代码。 实际代码在公司电脑上 不方便发上来。 出错的地方就是file.MergeWith这一行,错误提示请看标题。 实在抱歉 公司不可以外网,手机码字。 感谢您的帮助!
回复 使用道具 举报
文刀
注册会员   /  发表于:2016-11-30 19:51:19
地板
string fileName1 = @"C:\File1.pdf"; string fileName2 = @"C:\File2.pdf"; string fileName3 = @"C:\File3.pdf"; string finalFileName = @"C:\Final.pdf"; // Load first file PDFFile file = new PDFFile(fileName1); // Merge with second and third files, put the result in final file.MergeWith(new string[] { fileName2, fileName3 }, finalFileName); // Convert final file to PDF/A file = new PDFFile(finalFileName); file.ConvertToPDFA(null);   您好!我参照的是这段代码。 实际代码在公司电脑上 不方便发上来。 出错的地方就是file.MergeWith这一行,错误提示请看标题。 实在抱歉 公司不可以外网,手机码字。 感谢您的帮助!
回复 使用道具 举报
gw0506
超级版主   /  发表于:2016-12-1 13:48:16
5#
代码看起来没有问题。
https://www.leadtools.com/help/l ... tml?platform=dotnet
上面这个文档链接里就是示例代码。
  1. public void PDFFileMergeWithExample()
  2. {
  3.    string sourceFileName1 = Path.Combine(LEAD_VARS.ImagesDir, @"File1.pdf");
  4.    string sourceFileName2 = Path.Combine(LEAD_VARS.ImagesDir, @"File2.pdf");
  5.    string sourceFileName3 = Path.Combine(LEAD_VARS.ImagesDir, @"File3.pdf");
  6.    string destinationFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Merged.pdf");

  7.    // Merge 1 with (2, 3) and form destination
  8.    PDFFile pdfFile = new PDFFile(sourceFileName1);
  9.    pdfFile.MergeWith(new string[] { sourceFileName2, sourceFileName2 }, destinationFileName);
  10. }
复制代码


你出现这个问题很可能是license不支持。有可能是你购买了正式授权,但是授权中不包含PDF操作的功能模块,所以不能使用。
回复 使用道具 举报
文刀
注册会员   /  发表于:2016-12-1 16:14:59
6#
pdfFile.MergeWith(new string[] { sourceFileName2, sourceFileName2 }, destinationFileName);

执行这句代码的时候报:”PDF capability is required”

如果PDF功能不能使用的话,编译都不能通过吧。

是不是这句代码之前应该设置下PDF文件的属性(size)?
回复 使用道具 举报
gw0506
超级版主   /  发表于:2016-12-1 16:50:31
7#
编译的时候没法判断license问题。
你查一下购买合同,看看买的是什么,这个错误应该就是license不包含这部分授权的功能。
LeadTools不同功能模块license不同,价格也不一样。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部