Code128 barcode font and bookmark

Hi, one of the things we’re doing with Aspose.Words is to place a barcode into a bookmark which has the Code128 font.


It works fine but Word seems to be assigning this font to the character AFTER the bookmark too, so it’s unlikely to scan correctly.

We can’t immediately see an easy way of moving to this character just after the bookmark and removing it.
Is it possible to do this?

By the way Aspose.Words is absolutely perfect for what we need and works just great!

Many thanks.

Hi John,

Thanks for your query. In your case, please use the following code snippet to remove the next node after BookmarkEnd node.

<span style=“font-family:“Courier New”;color:#2B91AF;mso-ansi-language:EN-GB;
mso-no-proof:yes” lang=“EN-GB”>Document<span style=“font-family:“Courier New”;
mso-ansi-language:EN-GB;mso-no-proof:yes” lang=“EN-GB”> doc = new
Document(MyDir + “in.docx”);

DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveTo(doc.Range.Bookmarks["Bookmark"].BookmarkEnd);

builder.CurrentNode.NextSibling.Remove();

doc.Save(MyDir + "AsposeOut.docx");

If this does not help you, please share your document for investigation purposes.

Many thanks Tahir, that makes it very clear.

All the best,
John

Hi John,


Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.