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

Free Support Forum - aspose.com

Problem Printing Barcodes

I'm having trouble printing a Word document that contains a barcode. When I open the document in Word, the barcode displays correctly, but when I print through Aspose, it prints the text (*100* in my example). The barcode prints correctly when I print through Word instead of through code.

Here is the code I use to print (PrintJob is a class I have that holds the printer name, number of copies and some other details my application uses).

Dim wordDocument As Document

wordDocument = New Document(MergedFileName)

Dim printerSettings As New System.Drawing.Printing.PrinterSettings()

printerSettings.Copies = Convert.ToInt32(PrintJob.Copies)

printerSettings.PrinterName = PrintJob.Printer

printerSettings.PrintToFile = False

wordDocument.Print(printerSettings, MergedFileName)

My code also saves the document as a PDF, and there the barcode displays correctly! Here is the code I'm using to save the document as a PDF.

Dim pdfoption As PdfSaveOptions = New PdfSaveOptions()

pdfoption.CustomPropertiesExport = PdfCustomPropertiesExport.Standard

pdfoption.Compliance = PdfCompliance.Pdf15

wordDocument = New Document(MergedFileName)

wordDocument.Save(fullPDFFileName, pdfoption)

I've attached the files I'm working with, including the barcode font. I have Aspose.Words v14.6.0.0 installed.

My application runs as a service, and in my testing I'm running the service as my account which is a local admin.

Hi Ed,

Thanks for your inquiry. After an initial test with Aspose.Words for .NET 15.10.0, we were unable to reproduce this issue on our end. We would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. Hope, this helps.

Download Aspose.Words for .NET 15.11.0

Also, please make sure that your service has rights/permissions to access the fonts folder.

Best regards,

Thank you, upgrading to 15.11.0 did resolve the problem I was having with the barcode.