Some Help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • weicheong
    New Member
    • Mar 2009
    • 2

    #1

    Some Help needed

    Hi guys, i hav successfully retrieve xmpmetadata from a pdf file and load it in a memeory stream. My current problem is to create another function such that i can directly use the xmpmetadata from the stream and parse it through my xpathdocument reader function.

    This is my code for extracting the xmpmetadata:
    MemoryStream os = new MemoryStream();
    FileStream fs = new FileStream(PdfF ile, FileMode.OpenOr Create);
    PdfReader reader = new PdfReader(fs);
    fs.Close();
    byte[] streamBytes = reader.Metadata ;
    string meta = System.Text.ASC IIEncoding.ASCI I.GetString(str eamBytes);

    and this is my code to allow the xmpmetadata to parse through my method:

    XPathDocument doc = new XPathDocument(" securePdf_withX mp.pdf");
    //craete navigator
    XPathNavigator nav = doc.CreateNavig ator();



    XmlNamespaceMan ager ns = new XmlNamespaceMan ager(nav.NameTa ble);

    I wish to know what code to put in at the top of the codes to allow the xmpmeta from the stream and put inside the xpathdocument



    many thanks!
Working...