質問

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?

役に立ちましたか?

解決

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.

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top