开发者

Getting the title, author, etc. of a PDF using ABCpdf

开发者 https://www.devze.com 2023-01-12 12:42 出处:网络
I am using ABCpdf, and开发者_开发技巧 simply cannot obtain the title or author of a document programmatically. Cannot seem to find any good examples on WebSupergoo\'s site!Must be a simple issue.

I am using ABCpdf, and开发者_开发技巧 simply cannot obtain the title or author of a document programmatically. Cannot seem to find any good examples on WebSupergoo's site! Must be a simple issue.

Doc d = new Doc();
d.Read(path);
var y = d.GetInfo(d.Root, "/Title:Text");
var x = d.GetInfo(d.Root, "/publicfilePath:Text");


OK very very simple in the end.

This is how I am adding the information

            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);

This is how I need to obtain it

        var a = d.GetInfo(-1, "/Info/publicfilePath");
        var b = d.GetInfo(-1, "/Info/Title");
0

精彩评论

暂无评论...
验证码 换一张
取 消