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

Free Support Forum - aspose.com

Generate Bar Code in DOCX PDF using DISPLAYBARCODE Merge Fields in Word Header with PAGE NUMPAGES Fields using C# .NET

I would like to generate a barcode with these values in this order with a space between each.

{DISPLAYBARCODE {MERGEFIELD Member.LastName * Upper } { PAGE } { NUMPAGES } { MERGEFIELD Member.FirstName * Upper } CODE39 \d \t }

And I would like it to render as a barcode in word once its done.


Please see these input/output Word/PDF documents and try running the following code:

Document doc = new Document("E:\\Temp\\MergeBarcode_Template\\GenerateACustomBarCodeImage.docx");

doc.FieldOptions.BarcodeGenerator = (new CustomBarcodeGenerator());

doc.MailMerge.Execute(new String[] { "Member.LastName", "Member.FirstName" },
        new Object[] { "hafeez", "awais"});


Hope, this helps.