ダヴィッド・ジョーンズとAgorusがIron Suiteで新たな効率を生み出す
ミラン・ヨヴァノヴィッチがIronPDFを使用
チームが製品をデモ
using IronBarCode; using System.Drawing; // Reading a barcode is easy with IronBarcode! var resultFromFile = BarcodeReader.Read(@"file/barcode.png"); // From a file var resultFromBitMap = BarcodeReader.Read(new Bitmap("barcode.bmp")); // From a bitmap var resultFromImage = BarcodeReader.Read(Image.FromFile("barcode.jpg")); // From an image var resultFromPdf = BarcodeReader.ReadPdf(@"file/mydocument.pdf"); // From PDF use ReadPdf // To configure and fine-tune barcode reading, utilize the BarcodeReaderOptions class var myOptionsExample = new BarcodeReaderOptions { // Choose a reading speed from: Faster, Balanced, Detailed, ExtremeDetail // There is a tradeoff in performance as more detail is set Speed = ReadingSpeed.Balanced, // Reader will stop scanning once a single barcode is found (if set to false) ExpectMultipleBarcodes = true, // By default, all barcode formats are scanned for // Specifying a subset of barcode types to search for would improve performance ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional, // Utilize multiple threads to read barcodes from multiple images in parallel Multithreaded = true, // Maximum threads for parallelized barcode reading // Default is 4 MaxParallelThreads = 2, // The area of each image frame in which to scan for barcodes // Specifying a crop area will significantly improve performance and avoid noisy parts of the image CropArea = new Rectangle(), // Special setting for Code39 barcodes // If a Code39 barcode is detected, try to read with both the base and extended ASCII character sets UseCode39ExtendedMode = true }; // Read with the options applied var results = BarcodeReader.Read("barcode.png", myOptionsExample); // Create a barcode with one line of code var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8); // After creating a barcode, we may choose to resize myBarcode.ResizeTo(400, 100); // Save our newly-created barcode as an image myBarcode.SaveAsImage("EAN8.jpeg"); Image myBarcodeImage = myBarcode.Image; // Can be used as Image Bitmap myBarcodeBitmap = myBarcode.ToBitmap(); // Can be used as Bitmap
Install-Package BarCode
IronBarcodeは、画像ファイル(jpeg、png、jpg)からビットマップなどの変数を渡したいプログラム的なフォーマットまで、さまざまな標準フォーマットをサポートしています。さらに、IronBarcodeはPDFなどの外部フォーマットもサポートしており、あらゆるコードベースにシームレスに統合でき、開発者にファイルフォーマットと変数の柔軟性を提供します。
IronBarcode は、あらゆるファイル形式のバーコード リーダーであるだけでなく、Code39 などのすべての標準エンコードとフォーマットをサポートするバーコード ジェネレーターとしても機能します。 バーコードジェネレータのセットアップには、わずか2行のコードを必要とします。 低い参入障壁と開発者向けの豊富なカスタマイズオプションを備えたIronBarcodeは、バーコードに関連する全ての状況において第一の選択肢です。
Code39
まず、IronBarCode や System.Drawing などの必要なライブラリをインポートし、BarcodeWriter をインスタンス化して、12345 の文字列値と EAN8 の形式を持つバーコードを作成します。 その後、生成されたバーコードを希望するフォーマットで画像として保存します。 IronBarcode はバーコードを Image および Bitmap として作成することをサポートしているため、これにはさまざまなオプションがあります。
IronBarCode
System.Drawing
BarcodeWriter
12345
EAN8
Image
Bitmap
上記からわかるように、IronBarcodeを使用してバーコードを生成するにはわずか2行のコードだけで済み、その後使用のためにファイルとして保存します。 IronBarcodeはさらに、バーコードを状況に合わせてカスタマイズするための豊富なオプションを開発者に提供することでこれを拡張します。
ResizeTo メソッドを使用して、高さと幅を渡すことでバーコード画像のサイズを変更できます。
ResizeTo
上記と同様に、最初に BarcodeReader をインスタンス化し、ファイル パスを Read メソッドに渡し、それを変数として保存して、後で使用し、バーコード オブジェクトを操作します。 ReadPDF を使用した PDF などの外部形式を読み取るための指定されたメソッドがあります。 ただし、一般的な画像形式やビットマップの場合は、Read を使用します。
BarcodeReader
Read
ReadPDF
IronBarcodeは標準ファイルフォーマットからバーコードをスキャンすることを開発者に許可します。 ただし、特にプログラムによってバーコード ファイルのバッチを読み取る場合など、開発者が Read メソッドの動作を微調整する必要がある状況があります。 This is where BarcodeReaderOptions comes in. IronBarCode lets you fully customize things such as the speed at which it reads with Speed, whether multiple barcodes are expected in the file with ExpectedMultipleBarcodes, and what kind of barcodes they are with the property ExpectBarcodeTypes. これは、開発者が複数の画像から BarCode を読み取るために複数のスレッドを並列に実行したり、並列読み取り時に使用するスレッド数を制御したりすることを可能にします。
BarcodeReaderOptions
Speed
ExpectedMultipleBarcodes
ExpectBarcodeTypes
これらはIronBarcodeの力を示す特性のほんの一部です。 完全なリストについては、ドキュメントを参照してください。
詳細なガイドでバーコードの作成方法を学びましょう!
using IronBarCode; using IronSoftware.Drawing; // Choose which filters are to be applied (in order) // Set cacheAtEachIteration = true to save the intermediate image data after each filter is applied var filtersToApply = new ImageFilterCollection(cacheAtEachIteration: true) { new SharpenFilter(), new InvertFilter(), new ContrastFilter(), new BrightnessFilter(), new AdaptiveThresholdFilter(), new BinaryThresholdFilter(), new GaussianBlurFilter(), new MedianBlurFilter(), new BilateralFilter() }; BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions() { // Set chosen filters in BarcodeReaderOptions ImageFilters = filtersToApply, Speed = ReadingSpeed.Balanced, ExpectMultipleBarcodes = true, }; // Read with the options applied BarcodeResults results = BarcodeReader.Read("screenshot.png", myOptionsExample); AnyBitmap[] filteredImages = results.FilterImages(); // Export intermediate image files to disk for (int i = 0 ; i < filteredImages.Length ; i++) filteredImages[i].SaveAs($"{i}_barcode.png"); // Or results.ExportFilterImagesToDisk("filter-result.jpg");
IronBarcode には、BarcodeReaderOptions 内で簡単に適用できる、選択可能な画像前処理フィルターが多数用意されています。 Sharpen 、バイナリしきい値、 Contrastなど、画像の読み取りを改善する可能性のあるフィルターを選択します。 選択した順序が適用される順序であることに注意してください。
Sharpen
Contrast
各フィルター適用後の中間画像データを保存するオプションがあります。 これは、ImageFilterCollection の SaveAtEachIteration プロパティで切り替えることができます。
ImageFilterCollection
SaveAtEachIteration
コード例の主要ポイント:
Binary Threshold
cacheAtEachIteration
true
IronBarcodeの画像補正について詳しく見る
using IronBarCode; using System.Drawing; /*** CREATING BARCODE IMAGES ***/ // Create and save a barcode in a single line of code BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8).ResizeTo(400, 100).SaveAsImage("EAN8.jpeg"); /***** IN-DEPTH BARCODE CREATION OPTIONS *****/ // BarcodeWriter.CreateBarcode creates a GeneratedBarcode which can be styled and exported as an Image object or file GeneratedBarcode MyBarCode = BarcodeWriter.CreateBarcode("Any Number, String or Binary Value", BarcodeWriterEncoding.Code128); // Style the Barcode in a fluent LINQ-style fashion MyBarCode.ResizeTo(300, 150).SetMargins(20).AddAnnotationTextAboveBarcode("Example EAN8 Barcode").AddBarcodeValueTextBelowBarcode(); MyBarCode.ChangeBackgroundColor(Color.LightGoldenrodYellow); // Save the barcode as an image file MyBarCode.SaveAsImage("MyBarCode.png"); MyBarCode.SaveAsGif("MyBarCode.gif"); MyBarCode.SaveAsHtmlFile("MyBarCode.html"); MyBarCode.SaveAsJpeg("MyBarCode.jpg"); MyBarCode.SaveAsPdf("MyBarCode.Pdf"); MyBarCode.SaveAsPng("MyBarCode.png"); MyBarCode.SaveAsTiff("MyBarCode.tiff"); MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp"); // Save the barcode as a .NET native object Image MyBarCodeImage = MyBarCode.Image; Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap(); byte[] PngBytes = MyBarCode.ToPngBinaryData(); using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream()) { // Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF } // Save MyBarCode as an HTML file or tag MyBarCode.SaveAsHtmlFile("MyBarCode.Html"); string ImgTagForHTML = MyBarCode.ToHtmlTag(); string DataURL = MyBarCode.ToDataUrl(); // Save MyBarCode to a new PDF, or stamp it in any position on any page(s) of an existing document MyBarCode.SaveAsPdf("MyBarCode.Pdf"); MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 200, 50, 1); // Position (200, 50) on page 1 MyBarCode.StampToExistingPdfPages("ExistingPDF.pdf", 200, 50, new[] { 1, 2, 3 }, "Password123"); // Multiple pages of an encrypted PDF
この例では、さまざまな種類と形式のバーコードが作成、サイズ変更、保存できることがわかります。 おそらく、一行のコードで。
私たちの流暢なAPIを使用すると、生成されたバーコードクラスを使用して、マージンを設定し、サイズ変更し、注釈を付けることができます。 その後、これらは画像として保存され、IronBarcodeがファイル名から自動的に適切な画像タイプを仮定します:GIF、HTMLファイル、HTMLタグ、JPEG、PDF、PNG、TIFF、およびWindowsビットマップ。
We also have the StampToExistingPdfPage method, which allows a barcode to be generated and stamped onto an existing PDF. これは、一般的なPDFを編集したり、バーコードを介してドキュメントに内部識別番号を追加したりする場合に便利です。
StampToExistingPdfPage
using IronBarCode; using System; using System.Drawing; /*** STYLING GENERATED BARCODES ***/ // BarcodeWriter.CreateBarcode creates a GeneratedBarcode object which allows the barcode to be styled and annotated. GeneratedBarcode MyBarCode = BarcodeWriter.CreateBarcode("Iron Software", BarcodeWriterEncoding.QRCode); // Any text (or commonly, the value of the barcode) can be added to the image in a default or specified font. // Text positions are automatically centered, above or below. Fonts that are too large for a given image are automatically scaled down. MyBarCode.AddBarcodeValueTextBelowBarcode(); MyBarCode.AddAnnotationTextAboveBarcode("This is my barcode"); // Resize, add margins and check final image dimensions MyBarCode.ResizeTo(300, 300); // Resize in pixels MyBarCode.SetMargins(0, 20, 0, 20); // Set margins in pixels int FinalWidth = MyBarCode.Width; int FinalHeight = MyBarCode.Height; // Recolor the barcode and its background MyBarCode.ChangeBackgroundColor(Color.LightGray); MyBarCode.ChangeBarCodeColor(Color.DarkSlateBlue); if (!MyBarCode.Verify()) { Console.WriteLine("Color contrast should be at least 50% or a barcode may become unreadable. Test using GeneratedBarcode.Verify()"); } // Finally, save the result MyBarCode.SaveAsHtmlFile("StyledBarcode.html"); /*** STYLING BARCODES IN A SINGLE LINQ-STYLE EXPRESSION ***/ // Create a barcode in one line of code BarcodeWriter.CreateBarcode("https://ironsoftware.com", BarcodeWriterEncoding.Aztec).ResizeTo(250, 250).SetMargins(10).AddBarcodeValueTextAboveBarcode().SaveAsImage("StyledBarcode.png"); /*** STYLING QR CODES WITH LOGO IMAGES OR BRANDING ***/ // Use the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode // Logo will automatically be sized appropriately and snapped to the QR grid. var qrCodeLogo = new QRCodeLogo("ironsoftware_logo.png"); GeneratedBarcode myQRCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/", qrCodeLogo); myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen); myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen); myQRCodeWithLogo.SaveAsPng("QRWithLogo.Png").SaveAsPdf("MyVerifiedQR.html"); // Save as 2 different formats
このサンプルでは、バーコードに選択したテキストや、バーコード自体の値を任意のフォントで注釈を付けることができることがわかります。ターゲットマシンにそのフォントがインストールされていない場合、適切な類似フォントが選択されます。 バーコードはサイズ変更が可能で、余白を追加することができ、バーコード自体や背景の色も変更可能です。 その後、適切な形式で保存できます。
最後の数行のコードを見ると、Fluent Style 演算子を使用すると、System.Linq のように、わずか数行のコードでバーコードを作成してスタイル設定できることがわかります。
System.Linq
using IronBarCode; GeneratedBarcode MyBarCode = BarcodeWriter.CreateBarcode("1234567890", BarcodeWriterEncoding.Code128); // Save as a stand-alone HTML file without any image assets MyBarCode.SaveAsHtmlFile("MyBarCode.html"); // Save as a stand-alone HTML image tag which can be served in HTML files, ASPX or MVC Views. No image assets required, the tag embeds the entire image in its source content string ImgTag = MyBarCode.ToHtmlTag(); // Turn the image into a HTML/CSS Data URI. string DataURI = MyBarCode.ToDataUrl();
IronBarcodeには非常に便利な機能があり、自己完結型のHTMLとしてバーコードをエクスポートできます。このため、関連する画像アセットは必要ありません。 すべてがHTMLファイル内に含まれています。
私たちはHTMLファイル、HTML画像タグ、またはデータURIとしてエクスポートすることができます。
この例では:
BarcodeWriter.CreateBarcode
ToHtmlTag()
<img>
ToDataUri()
SaveAsHtmlFile()
製品、統合、またはライセンスの問い合わせであろうと、Ironの製品開発チームはすべての質問に対応します。Ironと対話を始め、このライブラリをプロジェクトで最大限に活用してください。
IronBarcode は、UPC A/E、EAN 8/13、Code 39、Code 93、Code 128、ITF、MSI、RSS 14/Expanded、Databar、CodaBar、QR、Styled QR、Data Matrix、MaxiCode、PDF417、Plessey、および Aztec などの大多数のバーコードおよび QR 規格を読み取り、生成します。結果はバーコードデータ、種類、ページ、テキスト、およびバーコード画像を提供し、アーカイブまたはインデックスシステムに最適です。
IronBarcode は自動的にバーコード画像を事前処理して速度と精度を向上させます。回転、ノイズ、歪み、傾きを補正して、スキャンまたはライブビデオフレームを読み取ります。バッチ処理サーバーアプリケーションに対応したマルチコア、マルチスレッドに準備ができています。単一および複数ページのドキュメントで1つまたは複数のバーコードを自動的に見つけます。複雑なAPIを必要とせずに特定のバーコードタイプまたはドキュメントの場所を検索します。
数行のコードで数分で始めましょう。依存関係なしで.NET用に簡単に使用できる単一DLLとして構築され、32 & 64ビットをサポートし、任意の.NET言語で使用できます。ウェブ、クラウド、デスクトップ、またはコンソールアプリケーションで使用し、モバイル & デスクトップデバイスをサポートします。
このソフトウェア製品をリンクからダウンロードできます。
QRのために構築 C#, .NET
PDF、JPG、TIFF、GIF、BMP、PNG、HTML 形式としてファイルまたはストリームに保存または印刷します。色、品質、回転、サイズ、テキストを設定します。C# バーコードプログラミング ツールボックスを IronPDF および IronOCR と一緒に使用して、完全な.NET ドキュメントライブラリを利用します。
無料のコミュニティ開発ライセンス。商用ライセンスは$749から。
C# .NET バーコード QR
Frank が C# .NET バーコードアプリケーション内で IronBarcode を使用してスキャン、写真、PDF ドキュメントからバーコードを読む方法をご覧ください…
C# .NET バーコード
Francesca は C# または VB アプリケーションで画像にバーコードを書き込むためのいくつかのヒントとコツを共有します。IronBarcode で利用できるすべてのオプションをどのように活用してバーコードを書くかをご覧ください…
QR .NET C# VB
Jenny のチームは IronBarcode を使って毎日何千もの QR を書いています。IronBarcode を最大限に活用するためのチュートリアルをご覧ください…
Ironのチームは、.NETソフトウェアコンポーネント市場で10年以上の経験があります。
私たちの開発チームと直接話す
シンプルな英語で書かれたオンラインマニュアル。
無料の開発ライセンス。商業ライセンスは$749から。
NuGetまたはDLLで数分で始めましょう。
無料で始める
トライアルフォームが正常に送信されました。試用キーはメールに届いているはずです。もし届いていない場合はsupport@ironsoftware.comにご連絡ください。
試用キーはメールに届いているはずです。もし届いていない場合はsupport@ironsoftware.comにご連絡ください。
ウォーターマークなしで本番環境でテスト。必要な場所で動作します。
完全に機能する製品を30日間利用できます。数分でセットアップして稼働します。
製品試用期間中、サポートエンジニアリングチームへのフルアクセス
製品とその主要機能のライブデモをご覧いただけます。
プロジェクト固有の機能推奨を取得
あなたが必要なすべての情報を持っていることを確認するために、すべての質問にお答えします。(コミットメントは一切ありません)。
トライアルライセンスキーについては、メールをご確認ください。
メールが届かない場合は、ライブチャットを開始するか、support@ironsoftware.com
義務のない相談を予約
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
30分間の個別デモを予約してください。
契約なし、カード詳細なし、コミットメントなし。
著作権 © Iron Software 2013-2026