HI ,
I want to create a child bookmark below the parent bookmark.Could you please let me know how to do that?
--Anand
HI ,
I want to create a child bookmark below the parent bookmark.Could you please let me know how to do that?
--Anand
Hi Anand,
//create
BookmarkEditor object and bind PDF<o:p></o:p>
com.aspose.pdf.kit.PdfBookmarkEditor editor = new com.aspose.pdf.kit.PdfBookmarkEditor();
editor.bindPdf("d:/pdftest/RSADocument_example1_pagebookmark.pdf");
//create Bookmark object and set appropriate attributes
Bookmark bm11 = new Bookmark();
bm11.setAction("GoTo");
bm11.setDestination("wen");
bm11.setTitle("firstchildoffirstchild");
//create another bookmark
Bookmark bm1 = new Bookmark();
bm1.setPageNumber(1);
bm1.setTitle("firstchild");
//create a list and add bookmarks in it
ArrayList aList1 = new ArrayList();
aList1.add(bm11);
bm1.setChildItem(aList1);
Bookmark bm2 = new Bookmark();
bm2.setPageNumber(2);
bm2.setTitle("secondchild");
Bookmark bm = new Bookmark();
bm.setPageNumber(1);
bm.setTitle("parent");
ArrayList aList = new ArrayList();
aList.add(bm1);
aList.add(bm2);
bm.setChildItem(aList);
//create bookmarks in the PDF file
editor.createBookmarks(bm);
//save output PDF file
editor.save("d:/pdftest/testCreateBookmarksOut.pdf");
Hi My requirement is like I am convrting office documents to pdf.I need to merge all thedocument and then have to create a single PDF on that.Then I am bookmarking the document name and thir corresponding page numbers.A document may have a child document.I need to intend those chlid documnent name in the bookmarks.A child document may also have another child document.I need to intend those under the first child document name.Like in below fashion.Please help on how to do that.
Like wise it should go..........
Hi Anand,
Hi Thank you for the update.Any how i found out a way on how to do this.As you suggested I have framed XML while converting the document to PDF and then imported XML in my converted PDF using importBookmarksWithXML.
Could you please share the XSD pattern alone on how to frame the parent child relationship in XML what are all the nodes ,elements attributes to set.
Hi Anand,
<?xml version=“1.0”
encoding=“ISO8859-1”?><o:p></o:p>
<Bookmark>
<Title Color="0 0 0" Page="0 Fit" Action="GoTo" Open="False">Parent<Title Color="0 0 0" Page="1 FitH 792" Action="GoTo">First Child<Title Color="0 0 0">Second Child
</Bookmark>
In case I have not properly understood your requirement, please share some further details.
Hi what does that 0 FIT and 1 FITH792 mean?Thank you.
Hi Anand,