Free Support Forum - aspose.com

Bookmark name with more than 40 characters is truncated after import using .NET


Hi All,

I am currently using the method builder.startbookmark("sometext");

But here this "sometext" is taking only 40 character length when i again load this document and search for this bookmark.

I will be getting various lengths of the strings that needs to be consider as bookmark.

Is there any possible way that i can achieve that?

Your help is highly appreciated here.

--Yashwanth

Hi Yashwanth,

Thanks for your query. I have tried to understand your query but unfortunately I have not completely understood your query. It would be great if you please share some more detail about your query along with sample document.

Hi Yashwanth,


Thanks for your inquiry. Yes, you’re right; Aspose.Words truncates the name of Bookmark during loading Document into DOM if it contains more than 40 characters. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-6831. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Moreover, I have used the following code snippet to reproduce the same issue on my side:

Document doc = new
Document();

DocumentBuilder builder = new DocumentBuilder(doc);

//Create a Bookmark with name conatining more than 40 characters

builder.StartBookmark("bm345678901234567890123456789012345678901234567890");

builder.Write("inside bookmark");

builder.EndBookmark("bm345678901234567890123456789012345678901234567890");

MemoryStream stream = new MemoryStream();

doc.Save(stream, SaveFormat.Docx);

Document reloaded = new Document(stream);

// But Bookmark's name property is returning first 40 chars only

Console.WriteLine(reloaded.Range.Bookmarks[0].Name);


Best Regards,

Hi Yashwanth,


Thanks for your patience.

It is to update you that our development team has finished working on your issue (WORDSNET-6831) and has come to a conclusion that your issue and the behaviour you’re observing is actually not a bug. The problem occurs because it is by MS WORD design that bookmark name length is limited to 40 characters. So, this issue has now been closed as ‘Not a Bug’.

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

Best Regards,

The issues you have found earlier (filed as WORDSNET-6831) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,


I tried with the latest dll (Aspose.words 11.8.0.0) that was provided here but still its not resolving if the bookmark has more than 40 characters.

Can anyone please help me here on how to resolve this?

–Yashwanth

Hi Yashwanth,


Thanks for your inquiry. As mentioned earlier, this behaviour is by MS WORD design that bookmark name length is limited to 40 characters only. There is no way you can override this behaviour using Aspose.Words. If we can help you with anything else, please feel free to ask.

Best Regards,

Hi Awais,

I'm a little confused. If it's not a bug, did the Aspose Notifier post a reply to this thread and did someone add this to the release notes by mistake?

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry416309.aspx

Hi Yashwanth,


We apologise for the inconvenience. Yes the message was generated out to you by an automated system and yes there was a mistake in release notes too. We’ll consider improving the auto notification system to avoid any confusions in future.

Best Regards,