Code 128 barcodes failing verification

The Code 128 barcodes that we're printing on Word documents generated by Aspose are failing during barcode verification using a Webscan TruCheck verifier. They're verifying at ANSI F grade and failing on the ANSI Decodabiity parameter. These barcodes are generally not readable. I'm getting the same results when printing to a Ricoh laser printer and a Kyocer laser printer.

The Aspose barcodes have very jagged edges that are probably factoring into this. I printed Code 128 barcodes through my Bartender labeling application, testing with X Dimensions of 10.8 mils and 14.2 mils and barcode heights of .5 in and .3 in.. All graded ANSI A on both Ricoh and Kyocera printers. These test barcodes have no jagged edges like the Aspose barcodes. I saved a copy of some barcodes printed with the evaluation version of Aspose and these barcodes did not have the jagged edges and verify at ANSI B grade.

Do you have any recommendations?

Hi Geoffrey,


Thank you for contacting support. Please share a bit more details about the barcode images. I mean the exact sample code by which you are generating 128 codes. Did you try using the latest version of Aspose.BarCode 6.1.0? Please note that the latest version gives you the best quality. We always recommend our customer use the latest version as it includes a number of new features, fixes and improvements. It will be so nice of you if you can share such sample barcodes in this forum thread. We’ll take a closer look and guide you accordingly.

Please refer to the download page:
http://www.aspose.com/community/files/51/.net-components/aspose.barcode-for-.net/default.aspx

We’re looking forward to help you.

We are using Aspose.Barcode version 6.0.0.0.

C# code that we're using to generate barcodes is attached.

Gave you the wrong code in the previous reply. See new attachment code.txt.

We tried with Aspose Barcode 6.1.0.0. No difference.

Hi Geoffrey,


Thank you for sharing the sample code. I’ve logged an investigation under ticket id BARCODENET-33885 in our issue tracking system. Our development team will look into the matter. It would be great if you can also share a source Word document. It will help us to be more specific. We’ll let you know once a significant progress has been made in this regard.

I've attached two documents. The first is the .docx template in which we use bookmarks to insert variable text and barcode data. Bookmark names for barcodes are prefaced by "BARCODE". The second document (PDF) is a scan of the printed document. If you zoom in, you will see the jagged edges on the barcode bars.

I’ve attached a copy of the actual output file (DBI_MVTKT_LODFD.docx). Interestingly, the barcodes are excellent with no jagged edges. When I open it in Word and print from Word, it prints a page with excellent barcodes which verify at ANSI grade A (3.9). However. when this file is printed to the same printer by the service application, it prints with poor quality barcodes as shown in the PDF attached earlier. I’ve attached a copy of the code in the service that does the print (see PrintCode.txt).

Hi Geoffrey,


Thank you for sharing the sample documents. It looks no issue with Aspose.BarCode API. Could you please elaborate regarding the printing mechanism? I’m not certain about the XpsPrintReady class. Second, it will be so nice of you if you can share a sample service application in this forum thread. It will help us to replicate the problem on our side.

We’re looking forward to help you.

After doing some further testing, it's been determined that the problem is manifesting itself on the server (Windows Server 2008 SP2), but not on the desktop. Both tests were done using the latest version of Aspose Words for .NET (14.3.0.0) and Aspose BarCode for .NET (6.1.0.0). So it's not a printer problem and appears not to be an applicaiton problem.

Hi Geoffrey,


Thank you for the details.
Geoff:
Interestingly, the barcodes are excellent with no jagged edges. When I open it in Word and print from Word, it prints a page with excellent barcodes which verify at ANSI grade A (3.9). However. when this file is printed to the same printer by the service application, it prints with poor quality barcodes as shown in the PDF attached earlier.
Well, the issue arises when you are printing through the service application. I’ve asked for a sample service application or source code in my earlier post here. Because the printing source code, you shared, is not sufficient for us to replicate the problem on our side. The XpsPrintReady class is not a part of Aspose.Words or Aspose.BarCode API.

We also require a verification about your quote:
Geoff:
When I open it in Word and print from Word, it prints a page with excellent barcodes which verify at ANSI grade A (3.9).
Can we say that you are opening and printing through Microsoft Office?

Please note that it is must for us to first understand the issue, we need to reproduce the issue at our end and then using the same information our product teams also need to reproduce the same issue at their end. This way we’re able to investigate, fix, and verify the issue.

We’re looking forward to help you.

I've attached two zip files. One is the VS 2010 solution for the service application. The second is a VS 2010 solution for a Windows Forms test application for printing a sample document. Calls to Aspose Words and Barcode are common in both solutions. You can build the test solution (ASPOSETestApp) and print the sample document that includes several barcodes. Make sure that you change the printer name to your printer in the following:

public partial class Form1 : Form
{
Dictionary PrintValues = new Dictionary();
string TemplatePath = @"../../InputLoadTemplate.docx";
//string TemplatePath = @"D:/ASPOSETestApp/bin/debug/InputLoadTemplate.docx";
string PrinterName = "EN08";

The document template (InputLoadTemplate.docx) is located in the ASPOSETestApp folder with other project files. The output file will be created in the same folder with the following filename syntax:

MyTestDocumentMMddyyyyHHmmssFFF.docx"

If I run the test app on my laptop, the barcodes in the document verify at ANSI A grade. If I run the test app on the server the barcodes contain jagged edges (just like the output of the service that runs on the server) and verify at ANSI F grade.

Forgot to confirm your question about Word...Yes, when we open the output file in Microsoft Word 2010 and print, the barcodes print fine.
Hi Geoffrey,

Thank you for sharing sample projects. We're working over your query and will get back to you shortly.

Hi Geoffrey,


Thank you for being patient. You are right because it works perfect in my local environment (Windows 7). We need to check further with Windows Server 2008 SP 2. It looks an issue with Aspose.Words API. I’m moving your request in Aspose.Total forum. My fellow worker from appropriate team will answer you shortly. We apologize for your inconvenience.

Hi Geoffrey,

Thanks for your inquiry. I have tested the scenario at Windows Server 2008 R2 and have not found the shared issue. I have noticed that you are using older version of Aspose.Words in your shared application here. Please use the latest version of Aspose.Words for .NET 14.3.0.

The XpsPrintReady save the Word document to XPS and then print the XPS file. Please note that Aspose.Words requires TrueType fonts when
rendering documents to fixed-page formats (PDF, XPS or SWF). I would suggest you please read the
following articles:

If the problem still remains, please save the generated Word document into XPS file format and print the XPS manually and share your finding. Please share that XPS file here for our reference. I have attached the output XPS file generated at my end with this post for your kind reference.

Aspose.Words.Document AsposeDoc = new Aspose.Words.Document(TemplatePath);

foreach (KeyValuePair<string, string> pair in MoveTktValues)

{

ReplaceBookmarkText(AsposeDoc, pair.Key, pair.Value);

}

AsposeDoc.Save(@“c:\temp\Out.Xps”, SaveFormat.Xps);

Solved by using the Ricoh "Driver for XPS", Ver. 1.00. The Ricoh PCL drivers produced good results on Windows 7, but produced poor bar code quality (jagged edges on bar and failed ANSI grades) on Windows Server 2008. Once I used the XPS driver, the jagged edges went away and the bar code grades went to A.

Thank you for your help.

Hi Geoffrey,


Thanks
for your feedback. It is nice to hear from you that your issue has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.