Problem with the bookmarks in Aspose Word

Hi,
I am using aspose.word and aspose.pdf to convert word documents into PDF. But I am running into a problem, because the text in pdf gets squeezed into less pages.
My problem is, I wanted to get the page number of a text or a bookmark. I consulted with Aspose.PDF team and they created a new function GetPageNumber which returns the page number of a bookmark. Please see this forum:

As per Aspose.PDF team, the Aspose.Word generates Paragraph ID as bookmark. But I want to use my application generated Bookmarks, so that after the document is converted into PDF I can get the page numbers of my bookmarks by using the GetPageNumber function in aspose.pdf.

Please, let me know how can I use my bookmarks and not the Paragraph ID. Thanks very much in advance.

Jerry.

Hi Jerry.
As you know bookmarks in MS Word and bookmarks in PDF are completely different terms. In MS Word a bookmark can be placed anywhere in the text, and it has start and end positions. In PDF a bookmark is a paragraph attribute which forces the paragraph to appear in the navigation pane or document map. In both models bookmarks are intended to refer some locations in documents.
When Aspose.Words converts a document to PDF it collects the bookmarks within each paragraph and replaces references to them by paragraph ID. So in PDF there are no original bookmarks. From the user’s point of view his (her) bookmarks are “propagated” to paragraph level.
If Aspose.Pdf team (Tommy) supports IDs at the text run level (Segment.ID) then we will convert bookmarks to these identifiers. From our side it’s not too difficult. But Aspose.Pdf should implement this first.
This subject is not new. I found some threads in the forum which possibly can bring more clarity (referred by Tommy from previous one)
In the further Aspose.Words is going to have its own pagination engine. So obtaining page number of any element will be possible. But we don’t give any time estimate on this.
For support of segment IDs in conversion to PDF I created new issue #3244.
Regards,

Hey Viktor,
Sorry I am little confused here. So, you mean you can convert the Segment.ID to the bookmarks I have inserted into that document? If that is the case, It is totally acceptable for me. I can put the bookmark in the starting of the paragraph/segment and can get the page number of that bookmark (which is basically the Segment.ID) by using GetPageNumber function in PDF.
But in either case I need to have a way to find out my own inserted bookmark’s page number and not the paragraph ID. Because these word documents are generated by my application and we cant predict the paragraph ID.
When can you give me this new enhancement where segmentID will be converted into Bookmark? Thanks in advance.
Jerry

Jerry,
I meant different things.
Aspose.Pdf theoretically can support segment IDs in the text. But this is not supported yet. We can ask Aspose.Pdf team to implement this improvement and only after it is ready on their side make some changes in our Aspose.Words to export MS Word bookmarks as segment IDs.
So the answer at this moment is no. But if you really need to have bookmarks converted to PDF let me know. I’ll escalate the problem.
Thank you for understanding,

Yes, I definitely want my bookmarks to be carried over to the PDF document. When do you think you should be able to release this enhancement?
Thanks,
Jerry

Hi Jerry.
As I promised the issue was escalated to Aspose.Pdf team. So the initiative is on their side now. I can let you know if only they promise me anything: to include into development plan, to implement by some particular date etc. And only after that I can estimate when it could be done in Aspose.Words. Now it is one of the known limitations.
Regards,

Hello, Is there any update on this issue?
-Jerry

Hi Jerry.
No, there isn’t. Aspose.Pdf will notify us when anything is planned or implemented.
The only thing I can do now is to ask them once more about this feature.
I’ll try to fetch any time estimate from them. (Already wrote an e-mail.)
Regards,

Hello,
Is there any update on this issues. I been waiting for the reply since last couple weeks.
Thanks,
Pulkit Zery

Hi,
I’ve just contacted the Aspose.PDF team. I believe they will update you shortly.
Thanks.

Hi,

  1. ID is supported in Segment in Aspose.Pdf. We can’t support bookmark like MS Word since there is NO such bookmark in PDF.
  2. In the next hotfix which will be published next monday, we will support GetPageNumber() from segment ID.
    So I think now what we need is Aspose.Words exports the bookmark name as segment ID.

Is any Aspose.Words team person is looking on this issue? I need this ASAP since this is the only loose thread we have to tie for the next version of our product. Please let me know if there are any updates on this on Aspose.Words side. Thanks very much.
Best regards,
Pulkit Zery

Yes, we are working on it. We will update you here as soon as the feature is implemented.
Thanks.

Hi,
Is there any update on this issue?
Thanks,
Jerry

Hi

Unfortunately, it is unresolved. We will post notification here in this thread as soon as it will be done.

Best regards.

Is there any update on this issue? We been waiting on this issue for a long time and it is holding the release of the next version of our software which is ready to roll out.
Jerry

Hi Jerry.
There are still some difficulties with bookmarks. We are collaborating with Aspose.Pdf to implement this. But I can not promise a quick fix.
If you need it urgently you can try a workaround: add an invisible paragraph with the smallest font immediately before the place you want to mark and populate it with bookmark’s name. So you would be able to find it, get its para ID and determine the page number.
Let me know whether it works or not.
Thank you for understanding,

We have released a new version of Aspose.Words that contains a fix for your issue.

The new version of Aspose.Words is available for download from here.
Best regards.

Is this issue resolved? I am facing the same problem.

Hi Shweta,

Thanks for your inquiry. Perhaps you’re using an older version of Aspose.Words. If this is the case, please note that this issue has now been resolved as Alexey already mentioned in the previous post. You can upgrade to the latest version of Aspose.Words i.e. 11.0.0. Moreover, I would suggest you read the following article on How-to: Migrate to Aspose.Words 10.5 or Higher:
https://docs.aspose.com/words/net/

If we can help you with anything else, please feel free to ask.

Best Regards,