我正在使用 ABCpdf,并且根本无法以编程方式获取文档的标题或作者。似乎在 WebSupergoo 的网站上找不到任何好的例子!应该是一个简单的问题。
Doc d = new Doc();
d.Read(path);
var y = d.GetInfo(d.Root, "/Title:Text");
var x = d.GetInfo(d.Root, "/publicfilePath:Text");
我正在使用 ABCpdf,并且根本无法以编程方式获取文档的标题或作者。似乎在 WebSupergoo 的网站上找不到任何好的例子!应该是一个简单的问题。
Doc d = new Doc();
d.Read(path);
var y = d.GetInfo(d.Root, "/Title:Text");
var x = d.GetInfo(d.Root, "/publicfilePath:Text");
OK 非常非常简单到底。
这就是我添加信息的方式
int theID = doc.AddObject("<< >>");
doc.SetInfo(-1, "/Info:Ref", theID.ToString());
publicPath = base.GetPublicSavePath(FilePrefix);
doc.SetInfo(theID, "/Title:Text", "here is where the title goes");
doc.SetInfo(theID, "/Author:Text", "WebSupergoo");
doc.SetInfo(theID, "/publicfilePath:Text", publicPath);
doc.Save(publicPath);
这就是我需要获得它的方式
var a = d.GetInfo(-1, "/Info/publicfilePath");
var b = d.GetInfo(-1, "/Info/Title");