ByteScout BarCode Generator SDK - ASP.NET - Non Visual class (VB.NET) - ByteScout

ByteScout BarCode Generator SDK – ASP.NET – Non Visual class (VB.NET)

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – ASP.NET – Non Visual class (VB.NET)

ByteScout BarCode Generator SDK – ASP.NET – Non Visual class (VB.NET)

Default.aspx.vb

[vb]
Imports System.Drawing.Imaging

Imports Bytescout.BarCode

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
‘ Create new barcode
Dim barcode As New Barcode()

‘ Set symbology
barcode.Symbology = SymbologyType.Code39
‘ Set value
barcode.Value = “Sample”

‘ Clear http output
Response.Clear()
‘ Set the content type to PNG
Response.ContentType = “image/png”
‘ Add content type header
Response.AddHeader(“Content-Type”, “image/png”)
‘ Set the content disposition
Response.AddHeader(“Content-Disposition”, “inline;filename=result.png”)

‘ Save image to output stream
barcode.SaveImage(Response.OutputStream, ImageFormat.Png)

‘ End response
Response.End()
End Sub
End Class

[/vb]

web.config

[text]































[/text]


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next