Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

.NET C# Barcode task...

Options
  • 05-10-2012 12:11pm
    #1
    Closed Accounts Posts: 3,912 ✭✭✭


    Hi Folks,

    I've recently upgraded the admin end of my website and one thing I was asked to integrate into my admin area is the ability to print off a barcode on my sales transaction shipping labels.

    Barcoding being a bit of a specialist subject, I decided I wasn't getting into trying to write the software that would create a barcode image, so after a bit of Googling, I came across this solution:

    http://www.codeproject.com/Articles/14409/GenCode128-A-Code128-Barcode-Generator

    Only problem is that it appears to have been written in C# for a windows desktop type application, whereas I want to somehow drop this solution into a .aspx page...

    Just wondering does this look like an easy task or would anyone have any pointers for this little exercise???

    Thanks in advance for any help with this,

    HFC...


Comments

  • Registered Users Posts: 1,311 ✭✭✭Procasinator


    Haven't looked into the code, but I don't see why this would be a problem.

    You would call Code128Rendering.MakeBarcodeImage, which returns an Image. Call Save on the Image with whatever format and filename/stream you need, and serve it up with a standard HTML img tag.

    Only thing to take into account would be performance and when to generate the image (in the background or as requested, for instance).


  • Registered Users Posts: 683 ✭✭✭JazzyJ


    From a quick glance at the code in the referenced project it looks to be generating an image within the code. You should be able to stream this out in the response using a HTTP handler. You basically want to take the image that's generated by the library and incorporate that into your web project. Something like this will provide pointers:

    http://www.c-sharpcorner.com/UploadFile/desaijm/HTTPHandlersForImages11152005062705AM/HTTPHandlersForImages.aspx

    If you're generating other types of barcodes other than Code128 you may need to look at maybe buying a component to provide these.

    There's also fonts out there for other barcode formats and you could use these through the graphics library e.g. http://social.msdn.microsoft.com/Forums/en-SG/csharpgeneral/thread/56537e22-74d8-46c3-9aec-8619e03f9cab. Bear in mind that this methodology will only work for certain types of barcodes as some may contain check digits etc.


  • Closed Accounts Posts: 3,912 ✭✭✭HellFireClub


    JazzyJ wrote: »
    From a quick glance at the code in the referenced project it looks to be generating an image within the code. You should be able to stream this out in the response using a HTTP handler. You basically want to take the image that's generated by the library and incorporate that into your web project. Something like this will provide pointers:

    http://www.c-sharpcorner.com/UploadFile/desaijm/HTTPHandlersForImages11152005062705AM/HTTPHandlersForImages.aspx

    If you're generating other types of barcodes other than Code128 you may need to look at maybe buying a component to provide these.

    There's also fonts out there for other barcode formats and you could use these through the graphics library e.g. http://social.msdn.microsoft.com/Forums/en-SG/csharpgeneral/thread/56537e22-74d8-46c3-9aec-8619e03f9cab. Bear in mind that this methodology will only work for certain types of barcodes as some may contain check digits etc.

    No its just code 128 barcodes I'm using, I've tested this bit of software I've referred to above, with my barcode scanners and it works fine, just need it to take in a string now via a webpage (.aspx) page and output it to the webpage as an image...


Advertisement