• How to Import Bookmark from xml to existing pdf?

    From backupnachi@gmail.com@21:1/5 to All on Mon Jun 27 20:38:13 2016
    I am currently working on pdf projects (dotnet/c#[Itextsharp pdf]), I want to export and import bookmarks from one pdf to another pdf (both pdf are having same content, only difference are with bookmark/without bookmark and one is normal pdf and another
    linked pdf). Exporting bookmarks to xml is working fine but I don`t have the idea of importing exported bookmark(xml) to another pdf. Can any body suggest solution.

    Here I am attaching my code.

    string inputpdf = "D:\\chapter1.pdf"; string outputbookmark="D:\\chapter1Bookmark.xml";
    PdfReader reader = new PdfReader(inputpdf);
    IList<Dictionary<string, object>> bookmarks = SimpleBookmark.GetBookmark(reader);
    using (StreamWriter Sw = new StreamWriter(outputbookmark))
    {
    SimpleBookmark.ExportToXML(bookmarks, Sw,"ISO8859-1", true);

    }
    reader.Close();

    My xml output file is
    <?xml version="1.0" encoding="ISO8859-1"?>
    <Bookmark>
    <Title Color="0 0 0" Page="1 XYZ 36 806" Action="GoTo" >Introduction</Title>
    <Title Color="0 0 0" Page="1 XYZ 36 410" Action="GoTo" >Getting Started
    <Title Color="0 0 0" Page="1 XYZ 36 364" Action="GoTo" >Printing a test page</Title>
    <Title Color="0 0 0" Page="4 XYZ 36 740" Action="GoTo" >Accessing the novaPDF Printing Preferences &#8211; test the multiline bookmark detection option</Title>
    <Title Color="0 0 0" Page="5 XYZ 36 806" Action="GoTo" >Creating PDF Files</Title>
    </Title>
    </Bookmark>

    My Pdf file available in

    http://www.novapdf.com/uploads/novapdf_en/media_items/pdf-example-bookmarks.original.pdf

    Please suggest solution.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)