2010-08-19 5 views
2

J'utilise ABCpdf, et je ne peux pas obtenir le titre ou l'auteur d'un document par programmation. Impossible de trouver de bons exemples sur le site de WebSupergoo! Doit être un problème simple.Obtenir le titre, l'auteur, etc. d'un PDF en utilisant ABCpdf

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

Répondre

3

OK très très simple à la fin.

Voilà comment je suis d'ajouter les informations

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

Voici comment je dois obtenir

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

Fantastique! Exactement ce que je cherchais! – Chaitanya

Questions connexes