Free Support Forum - aspose.cloud

How to add Bookmark in PDF document in Nodejs using Aspose.PDF REST API

I am trying to use the NodeJS PDF library to add a bookmark to a file. I am confused by what bookmarkPath is. Let’s say I wanted to add a bookmark on page 5 of a document in my default storage called “test.pdf”. What would this attribute be?

When I put a page number in as the bookmarkPath value, I get this:

Invalid index: index should be in the range [1..n] where n equals to the bookmarks count.

So what does bookmarkPath mean, and what value do I need to insert?

@leverarch

We are sorry for your inconvenience. We have noticed the reported issue and logged a ticket PDFCLOUD-1452 for further investigation and rectification. We will notify you as soon as the issue is resolved.

Thanks - while you’e fixing it, could you explain what bookmarkPath actually means? I can’t find any reference to it elsewhere as to what it actually means…

@leverarch

Thanks for your feedback. I’m checking your query and will share the details shortly.

@leverarch

Please note, in reference to PDFCLOUD-1452, the bookmarkPath parameter points to the parent bookmark in the bookmark tree. If you want to add a bookmark to the root, you must specify an empty string as the path.