We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Using a CustomBarcodeGenerator

Hi all,

I’m very glad to see the CustomBarcodeGenerator system. It’s very useful.
I have one problem with it though. When the Word Barcode field uses a field value internally then the barcode isn’t rendered.
For example we use { DISPLAYBARCODE
“[[case-id]]-{ PAGE }” \h 720 }
to encode a page number as part of the barcode. This is passed to our CustomBarcodeGenerator as “[[case-id]]-1”,"[[case-id]]-2","[[case-id]]-3" etc. We then replace the [[case-id]] part of the string, generate the bar-code image and return that.
If I leave out the { PAGE } part then the barcode is added into the document, but otherwise it is left out altogether. I suspect that aspose.word is passing the right data through but then tries to place the barcode into the page by searching for “[[case-id]]-1” (etc), not "[[case-id]]-{ PAGE }"

Has anyone else had any experience with this? any tricks/workarounds?

Hi Keith,


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document
  • Aspose.Words generated output document which shows the undesired behavior
  • Your expected document which shows the correct output. Please create this document using Microsoft Word application.
  • Please create a standalone console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,