Przejdź do treści stopki
C# + VB.NET: Barcode Quickstart Barcode Quickstart
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 file
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 true)
    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");

// Get the barcode as an image for further processing
var myBarcodeImage = myBarcode.Image;
Imports IronBarCode
Imports System.Drawing

' Reading a barcode is easy with IronBarcode!
Dim resultFromFile = BarcodeReader.Read("file/barcode.png") ' From a file
Dim resultFromBitMap = BarcodeReader.Read(New Bitmap("barcode.bmp")) ' From a bitmap
Dim resultFromImage = BarcodeReader.Read(Image.FromFile("barcode.jpg")) ' From an image file
Dim resultFromPdf = BarcodeReader.ReadPdf("file/mydocument.pdf") ' From PDF use ReadPdf

' To configure and fine-tune barcode reading, utilize the BarcodeReaderOptions class
Dim myOptionsExample As New BarcodeReaderOptions With {
    ' 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 true)
    .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
Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)

' Create a barcode with one line of code
Dim 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")

' Get the barcode as an image for further processing
Dim myBarcodeImage = myBarcode.Image
Install-Package BarCode

IronBarcode obsługuje różne standardowe formaty, od plików graficznych (jpeg, png i jpg) po bardziej programistyczne formaty, w których można przekazywać zmienne, takie jak bitmapa. Dodatkowo, obsługuje także formaty zewnętrzne, takie jak PDF, umożliwiając IronBarcode łatwą integrację z dowolnym kodem, dając programistom elastyczność w zakresie formatów plików i zmiennych.

Poza tym, że jest czytnikiem kodów kreskowych dla wszystkich formatów plików, IronBarcode działa także jako generator kodów kreskowych, który obsługuje wszystkie standardowe kodowania i formatowania, takie jak EAN8, Code128 i Code39. Konfiguracja generatora kodów kreskowych zajmuje tylko dwie linie kodu. Z niskim progiem wejścia i wieloma opcjami dostosowywania dla programistów, IronBarcode jest numerem jeden w każdej sytuacji związanej z kodami kreskowymi.

Czytnik kodów kreskowych i generator kodów kreskowych w C

  1. `var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeEncoding.EAN8);`
  2. `Image myBarcodeImage = myBarcode.ToImage();`
  3. `myBarcode.ResizeTo(400, 100);`
  4. `var resultFromFile = BarcodeReader.Read(@"file/barcode.png");`
  5. `var myOptionsExample = new BarcodeReaderOptions { /* Options */ };`

Barcode Writer

Najpierw importujemy niezbędne biblioteki, takie jak IronBarCode i System.Drawing, i inicjujemy BarcodeWriter, aby stworzyć kod kreskowy z wartością łańcucha 12345 w formacie EAN8. Następnie zapisujemy wygenerowany kod kreskowy jako obraz w żądanym formacie. Istnieją różne opcje dla tego, ponieważ IronBarcode obsługuje tworzenie kodu kreskowego jako Image oraz jako Bitmap.

Zaawansowany generator kodów kreskowych

Jak pokazano powyżej, generowanie kodu kreskowego przy użyciu IronBarcode wymaga tylko dwóch linii kodu i zapisania go jako pliku do późniejszego użycia. IronBarcode dalej rozszerza to, zapewniając programistom wiele opcji dostosowywania kodu kreskowego do sytuacji.

Możemy użyć metody ResizeTo i przekazać wysokość oraz szerokość, aby zmienić rozmiar obrazu kodu kreskowego.

BarCode Reader

Podobnie jak powyżej, najpierw inicjujemy BarcodeReader, przekazujemy ścieżkę pliku do metody Read i zapisujemy ją jako zmienną do późniejszego użycia i manipulacji obiektem kodu kreskowego. Istnieją określone metody do odczytywania formatów zewnętrznych, takich jak PDF, z ReadPDF; jednak w przypadku ogólnych formatów obrazów i bitmap używamy Read.

Opcje BarcodeReader

IronBarcode umożliwia programistom skanowanie kodów kreskowych ze standardowego formatu plików. Jednak są sytuacje, w których programiści chcą dostroić zachowanie metody Read, zwłaszcza w przypadkach, gdy odczytuje ona partię plików kodów kreskowych programistycznie. W tym miejscu do gry wchodzi BarcodeReaderOptions. IronBarCode umożliwia pełne dostosowanie takich ustawień jak prędkość odczytu za pomocą właściwości Speed, informacja o tym, czy w pliku spodziewanych jest wiele kodów kreskowych za pomocą ExpectedMultipleBarcodes, oraz rodzaj kodów kreskowych za pomocą właściwości ExpectBarcodeTypes. Dzięki temu programiści mogą uruchamiać wiele wątków do odczytywania kodów kreskowych z wielu obrazów równolegle, a także kontrolować liczbę wątków używanych podczas wykonywania równoległego odczytu.

To tylko niektóre właściwości, które demonstrują siłę IronBarcode. Aby uzyskać pełną listę, zapoznaj się z dokumentacją tutaj.

Naucz się tworzyć kody kreskowe z naszym szczegółowym przewodnikiem!

C# + VB.NET: Imperfect Barcodes and Image Correction Imperfect Barcodes and Image Correction
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");
Imports IronBarCode
Imports 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
Private filtersToApply = New ImageFilterCollection(cacheAtEachIteration:= True) From {
	New SharpenFilter(),
	New InvertFilter(),
	New ContrastFilter(),
	New BrightnessFilter(),
	New AdaptiveThresholdFilter(),
	New BinaryThresholdFilter(),
	New GaussianBlurFilter(),
	New MedianBlurFilter(),
	New BilateralFilter()
}

Private myOptionsExample As New BarcodeReaderOptions() With {
	.ImageFilters = filtersToApply,
	.Speed = ReadingSpeed.Balanced,
	.ExpectMultipleBarcodes = True
}

' Read with the options applied
Private results As BarcodeResults = BarcodeReader.Read("screenshot.png", myOptionsExample)

Private filteredImages() As AnyBitmap = results.FilterImages()

' Export intermediate image files to disk
For i As Integer = 0 To filteredImages.Length - 1
	filteredImages(i).SaveAs($"{i}_barcode.png")
Next i

' Or
results.ExportFilterImagesToDisk("filter-result.jpg")
Install-Package BarCode

IronBarcode oferuje wiele filtrów wstępnego przetwarzania obrazu, które można łatwo zastosować w ramach BarcodeReaderOptions. Wybierz filtry, które mogą poprawić odczyt obrazu, takie jak Sharpen, Binary Threshold i Contrast. Prosimy pamiętać, że kolejność, w jakiej je wybierasz, jest kolejnością, w jakiej są stosowane.

Jest opcja zapisu danych obrazu pośrednich obrazów z każdym zastosowanym filtrem. Można to przełączać za pomocą właściwości SaveAtEachIteration w ImageFilterCollection.

Kluczowe punkty z przykładowego kodu:

  • Tworzymy instancję BarcodeReaderOptions i konfigurujemy ją z różnymi filtrami obrazu: Sharpen, Binary Threshold i Contrast.
  • Filtry są dodawane w określonej kolejności, wskazując kolejność ich stosowania.
  • Ustawiając cacheAtEachIteration na true, biblioteka zapisuje pośrednie obrazy po każdej aplikacji filtra, co jest przydatne do debugowania i analizy.
  • Na koniec odczytujemy kod kreskowy z obrazu i drukujemy typ oraz wartość kodu kreskowego na konsoli.

Dowiedz się więcej o korekcji obrazu w IronBarcode

C# + VB.NET: Creating Barcodes Images Creating Barcodes Images
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
Imports IronBarCode
Imports 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
Dim MyBarCode As GeneratedBarcode = 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
Dim MyBarCodeImage As Image = MyBarCode.Image
Dim MyBarCodeBitmap As Bitmap = MyBarCode.ToBitmap()

Dim PngBytes() As Byte = MyBarCode.ToPngBinaryData()

Using PdfStream As System.IO.Stream = MyBarCode.ToPdfStream()
	' Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
End Using

' Save MyBarCode as an HTML file or tag
MyBarCode.SaveAsHtmlFile("MyBarCode.Html")
Dim ImgTagForHTML As String = MyBarCode.ToHtmlTag()
Dim DataURL As String = 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, { 1, 2, 3 }, "Password123") ' Multiple pages of an encrypted PDF
Install-Package BarCode

W tym przykładzie widzimy, że kody kreskowe wielu różnych typów i formatów mogą być tworzone, zmieniane rozmiarowo i zapisywane; możliwe nawet w jednej linii kodu.

Używając naszego płynnego API, wygenerowana klasa kodu kreskowego może być używana do ustawiania marginesów, zmiany rozmiaru i adnotowania kodów kreskowych. Następnie mogą być zapisane jako obrazy, a IronBarcode automatycznie przyjmuje odpowiedni typ obrazu na podstawie nazwy pliku: GIF-y, pliki HTML, tagi HTML, JPEG-i, PDF-y, PNG-i, TIFF-y oraz Windows Bitmaps.

Dostępna jest również metoda StampToExistingPdfPage, która umożliwia wygenerowanie kodu kreskowego i nałożenie go na istniejący plik PDF. Jest to przydatne przy edytowaniu ogólnego PDF-a lub dodawaniu wewnętrznego numeru identyfikacyjnego do dokumentu poprzez kod kreskowy.

C# + VB.NET: Barcode Styling & Annotation Barcode Styling & Annotation
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
Imports IronBarCode
Imports System
Imports System.Drawing

'*** STYLING GENERATED BARCODES  ***

' BarcodeWriter.CreateBarcode creates a GeneratedBarcode object which allows the barcode to be styled and annotated.
Dim MyBarCode As GeneratedBarcode = 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

Dim FinalWidth As Integer = MyBarCode.Width
Dim FinalHeight As Integer = MyBarCode.Height

' Recolor the barcode and its background
MyBarCode.ChangeBackgroundColor(Color.LightGray)
MyBarCode.ChangeBarCodeColor(Color.DarkSlateBlue)
If Not MyBarCode.Verify() Then
    Console.WriteLine("Color contrast should be at least 50% or a barcode may become unreadable. Test using GeneratedBarcode.Verify()")
End If

' 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.

Dim qrCodeLogo = New QRCodeLogo("ironsoftware_logo.png")
Dim myQRCodeWithLogo As GeneratedBarcode = 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
Install-Package BarCode

W tym przykładzie widzimy, że kody kreskowe mogą być oznakowane tekstem wybranym przez użytkownika lub własnym tekstem kodu kreskowego przy użyciu dowolnej czcionki zainstalowanej na docelowej maszynie. Jeśli ta czcionka nie jest dostępna, zostanie wybrana odpowiednia podobna czcionka. Kody kreskowe mogą być zmieniane, można dodawać marginesy, a zarówno kod kreskowy, jak i tło mogą być kolorowane. Następnie mogą być zapisane w odpowiednim formacie.

Na ostatnich kilku liniach kodu widać, że przy użyciu naszych operatorów stylu płynnościowego można stworzyć i wystylizować kod kreskowy w zaledwie kilku liniach kodu, podobnie jak System.Linq.

C# + VB.NET: Export Barcodes as HTML Export Barcodes as HTML
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();
Imports IronBarCode

Private MyBarCode As GeneratedBarcode = 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
Dim ImgTag As String = MyBarCode.ToHtmlTag()

' Turn the image into a HTML/CSS Data URI.
Dim DataURI As String = MyBarCode.ToDataUrl()
Install-Package BarCode

IronBarcode ma bardzo przydatną funkcję umożliwiającą wyeksportowanie kodów kreskowych jako samodzielne HTML, które nie zawiera powiązanych zasobów obrazów. Wszystko jest zawarte w pliku HTML.

Możemy eksportować jako plik HTML, tag obrazka HTML lub do danych URI.

W tym przykładzie:

  • Tworzymy kod kreskowy używając BarcodeWriter.CreateBarcode, określając dane wejściowe i typ kodowania.
  • Następnie używamy różnych metod dostarczanych przez IronBarcode do eksportu kodu kreskowego:
  • ToHtmlTag() generuje tag HTML <img>, który można osadzić na stronach internetowych.
  • ToDataUri() tworzy ciąg danych URI, który można użyć jako źródło dla tagów <img> lub praktycznie wszędzie tam, gdzie potrzebny jest URL obrazu.
  • SaveAsHtmlFile() zapisuje kod kreskowy jako samodzielny plik HTML, zawierający wszystkie dane obrazów, co czyni go przenośnym i łatwym do udostępnienia.

Human Support related to C# QR Code Library

Human Support Directly From Our Development Team

Whether it's product, integration or licensing queries, the Iron product development team is on hand to support all of your questions. Get in touch and start a dialog with Iron to make the most of our library in your project.

Zadaj pytanie
Recognizes Barcode Qr related to C# QR Code Library

Finds Multiples QR Code Types

IronBarcode reads and generates the majority of barcode and QR standards including 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, and Aztec. Results provide barcode data, type, page, text, and barcode image; ideal for archive or indexing systems.

See Full Function List
Fast And Polite Behavior related to C# QR Code Library

Fast & Accurate Reading with Image Pre Processing

IronBarcode automatically pre processes barcode images to improve speed and accuracy. Correcting rotation, noise, distortion and skewing to read scans or live video frames. Multi core, multi thread ready for batch processing server applications. Automatically find one or multiple barcodes in single and multi page documents. Search for specific barcode types or document locations without the need for complex APIs.

Learn More
Built For Dot Net related to C# QR Code Library

Built for easy use in .NET Core, Standard & Framework Projects

Get started in minutes with a few lines of code. Built for the .NET as an easy to use single DLL; without dependencies; supporting 32 & 64 bit; in any .NET Language. Use in Web, Cloud, Desktop or Console Applications; supporting Mobile & Desktop devices.

You can download the software product from this link.

Built for QR, C#, .NET

Get Started Now
Write Barcodes related to C# QR Code Library

Write QR Codes to Multiple Formats

Save or Print to a file or stream, as PDF, JPG, TIFF, GIF, BMP, PNG, or HTML formats. Set colour, quality, rotation, size and text. Use the C# Barcode Programming toolbox along with IronPDF and IronOCR for a full .NET Document Library.

Learn More
Supports:
  • .NET Core 2.0 and above
  • .NET Framework 4.0 and above support C#, VB, F#
  • Microsoft Visual Studio. .NET Development IDE Icon
  • NuGet Installer Support for Visual Studio
  • JetBrains ReSharper C# language assistant compatible
  • Microsoft Azure C# .NET  hosting platform compatible

Licensing & Pricing

Free community development licenses. Commercial licenses from $749.

Project C# + VB.NET Library Licensing

Project

Developer C# + VB.NET Library Licensing

Developer

Organization C# + VB.NET Library Licensing

Organization

Agency C# + VB.NET Library Licensing

Agency

SaaS C# + VB.NET Library Licensing

SaaS

OEM C# + VB.NET Library Licensing

OEM

View Full License Options  

QR code Tutorials for C# & VB .NET

Tutorial + Code Examples Reading Barcodes in C# | .NET Tutorial

C# .NET BarCode QR

Frank Walker .NET Product Developer

Read Barcodes & QRs | C# VB .NET Tutorial

See How Frank uses IronBarcode to Read Barcodes from Scans, Photos, & PDF documents inside his C# .NET Barcode Application...

View Frank's Barcode Reading Tutorial
Writing Barcode Tutorial + Code Examples in C# & VB.NET

C# .NET BarCode

Francesca Miller Junior .NET Engineer

Generating Barcode Images in C# or VB.NET

Francesca shares some tips and tricks for writing Barcodes to Images in C# or VB Applications. See how to write the barcodes and all the options available to you with IronBarcode...

See Francesca's Barcode Tutorial
Tutorial + Code Examples VB.NET PDF Creation and Editing | VB.NET & ASP.NET PDF

QR .NET C# VB

Jennifer Wright Application Architecture Lead

Tutorial for Writing QR codes in C# & VB .NET Applications

Jenny's Team use IronBarcode to write thousands of QRs per day. See their tutorial on getting the most out of IronBarcode...

QR Writing Tutorial from Jenny's Team
Thousands of developers use IronBarcode for...

Accounting and Finance Systems

  • # Receipts
  • # Reporting
  • # Invoice Printing
Add PDF Support to ASP.NET Accounting and Finance Systems

Business Digitization

  • # Dokumentacja
  • # Ordering & Labelling
  • # Paper Replacement
C# Business Digitization Use Cases

Enterprise Content Management

  • # Content Production
  • # Document Management
  • # Content Distribution
.NET CMS PDF Support

Data and Reporting Applications

  • # Performance Tracking
  • # Trend Mapping
  • # Reports
C# PDF Reports
Iron Software Enterprise .NET Component Developers

Thousands of corporations, governments, SMEs and developers alike trust Iron software products.

Iron's team have over 10 years experience in the .NET software component market.

Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon

Zespol wsparcia Iron

Jestesmy online 24 godziny, 5 dni w tygodniu.
Czat
Email
Zadzwon do mnie