Question

I am using PDF File Writer C# Class Library. I want to print a barcode. How can I add the Barcode 39 font to this library?

Was it helpful?

Solution

Per the example project in the source, you can reference fonts on the local system with the following:

PdfFont ArialNormal = new PdfFont(Document, "Arial", FontStyle.Regular, true);
Contents.DrawText(ArialNormal, NoteSize, NoteX, NoteY0, "text goes here");

If you install this Barcode font you should be able to reference it in the same way. Note: you may want to close Visual Studio, install the font, then reopen (or reboot) to ensure you're referencing the updated font list.

OTHER TIPS

Please note the PDF File Writer C# Class Library (Version 1.5) supports barcode. The supported codes are Code-39, Code-128, UPC-A and EAN-13. This support is without using fonts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top