Free Support Forum -

Barcode image missing while creating pdf attachment from word document


I am using Aspose words to fetch an existing word document and save it as a memory stream of pdf type.

And then I am using Aspose.Email.Attachment to create a pdf attachment.

The barcode images are not being exported, we see *text* in place of image.

I have the barcode ttf file at some location. How do I show the barcode image?

Here is my code:

var file = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

//Load it into aspose document object

Document doc = new Document(file);

MemoryStream ms = new MemoryStream();

//Save it as a PDF type of memory stream

doc.Save(ms, SaveFormat.Pdf);

Attachment at = new Attachment(ms, new Aspose.Email.Mime.ContentType("application/pdf"));

Hi Shah,

Thanks for your inquiry. Could you please attach your input Word document and output PDF document showing the undesired behaviour here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Thanks Awaiz,

The documents are confidential and I cant share them.

I noticed that I am not able to see the barcode in the original word document as well. Is there a way in Aspose.Words/Aspose.PDF to reference the font folder location?

Hi Shah,

Thanks for your inquiry. Please refer to the following sections of the documentation which outlines everything you need to know about your requirement:

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

Best regards,