Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4341268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:27:42+00:00 2026-05-21T11:27:42+00:00

I am using ASP .Net 3.5 MVC1 with a DB2 backend. My company is

  • 0

I am using ASP .Net 3.5 MVC1 with a DB2 backend. My company is trying to print Barcodes from the Microsoft SQL Server 2008 RSCLient Print GDI+ dialog box. We can’t save files to a PDF and print local because this is for our Physical Inventory Application, and associates might could do bad stuff with local Barcodes (they are as good checks) so we are forced to print over HTTP and control their printing. Each store has a print server on location, but the web server is located in the corporate IT office. I believe i have to use a .jpeg because a .gif will cause the lines in the barcode to blur and not be readable by a scanning gun.

The application works fine with a few hundred tags (about 5 pages and about 5 min to finish the print spool), but it takes 2 hours to print 2000 tags (close to 300 pages about +150 MB). I ran Wireshark on the application to try and catch the packets coming back and forth, and passed the information on to networking and this was their response.

NO. Time Source Destination Protocol Info
36628 653.373235 HTTP [TCP Window Full] Continuation or non-HTTP traffic
36630 654.245430 TCP [TCP ZeroWindowProbe] http > 35503 [ACK] Seq=26291213 Ack=3730 Win=63137 Len=1

I digress on the back story. My question is what type of strategy can i use to help speed up the print spool over HTTP. Should i “chop” the print spool off at X pages and re spool the rest? Should i change my printing algorithm? What would be a way to shrink my size of my print spool without losing the .jpeg quality? Is there and opensource or commercial alternative to RSClientPrint that will handle the business logic i need?

Now for coding goodness! If you need anything else please let me know!

        [AcceptVerbs(HttpVerbs.Post)]
    [Authorization(Roles = Roles.NonInquiry)]
    public ActionResult ReprintLabels(int eventId, int areaCode, int lowerLabelNumber, int upperLabelNumber)
    {
        if (!_eventAreaService.IsAreaEditable(eventId, areaCode))
            return RedirectToAction("Index", new { eventId = eventId });

        var printContext = _eventAreaService.ReprintLabels(eventId, areaCode, lowerLabelNumber, upperLabelNumber);

        ActionResult result = RedirectToAction("Index", new { eventId = eventId });
        if (printContext != null)
        {
            var redirectUrl = Url.RouteUrl(new { controller = "EventArea", action = "Index", eventId = eventId });
            Session[PrintContextViewModel.SessionKey] = new PrintContextViewModel(printContext, redirectUrl);

            result = RedirectToAction("PrintLabels", "LabelPrint");
        }

        return result;
    }

public InventoryAreaPrintContext ReprintLabels(int eventId, int areaCode, int lowerLabelBound, int upperLabelBound)
    {
        var user = _authentication.CurrentUser;

        if (user.IsInRole(Roles.CorporateInquiry) || user.IsInRole(Roles.StoreInquiry))
            throw new InvalidOperationException("User must be a non-inquiry role.");

        List<Fixture> fixturesToVoid = GetLabelsInRange(eventId, areaCode, lowerLabelBound, upperLabelBound).Where(f => f.StatusCode == FixtureStatus.Ready).ToList();

        if (fixturesToVoid.Count < 1) return null;

        // Void all old labels and tally the labels that to be recreated
        //      for each area involved.
        var voidFixturesByArea = new Dictionary<int, int>();
        foreach (var f in fixturesToVoid)
        {
            if (!voidFixturesByArea.ContainsKey(f.AreaCode))
                voidFixturesByArea[f.AreaCode] = 1;
            else
                voidFixturesByArea[f.AreaCode]++;

            f.StatusCode = FixtureStatus.VoidReplace;
            _fixtureRepo.Update(f);
        }

        var storeEvent = _storeEventRepository.FindEvent(user.DefaultStore, eventId);
        var lastUsedLabel = storeEvent.LastUsedLabelNumber;
        var affectedAreas = new List<InventoryArea>();

        // Create new labels for the affected areas.
        foreach (var pair in voidFixturesByArea)
        {
            var area = _areaRepo.FindByKey(user.DefaultStore.GroupCode, user.DefaultStore.ID, eventId, pair.Key);
            var fixtures = _fixtureBuilder.AddFixtures(lastUsedLabel.Value, area, pair.Value);
            fixtures.ForEach(f => _fixtureRepo.Insert(f));

            area.Fixtures = fixtures;
            affectedAreas.Add(area);
        }

        // Update the store event counts.
        var numberOfLabels = fixturesToVoid.Count();

        storeEvent.LastUsedLabelNumber += numberOfLabels;

        _storeEventRepository.Update(storeEvent);

        return new InventoryAreaPrintContext(_barcodeGenerator) { InventoryAreas = affectedAreas, StoreEvent = storeEvent, Store = user.DefaultStore };
    }

public class BarcodeGenerator : IBarcodeGenerator
{
    private readonly BarCodeImage.CodeSetEncoder _codeSetEncoder;

    public BarcodeGenerator(BarCodeImage.CodeSetEncoder codeSetEncoder)
    {
        _codeSetEncoder = codeSetEncoder;
    }

    public byte[] CreateBarcode(string barcodeText)
    {
        byte[] data;
        var generator = new BarCodeImage(barcodeText, _codeSetEncoder, true)
                            {
                                InsetText = false,
                                Font = new Font(
                                    FontFamily.GenericSansSerif,
                                    10,
                                    FontStyle.Regular,
                                    GraphicsUnit.Pixel)
                            };

        /** 
         * Keep the image dimensions at the same ratio as they will be displayed in the report.
         * Currently the report is set to a height to width ratio of 1/5 so we set the image
         * height to width at 1/5 as well. Otherwise the barcode will not scan properly.
         **/
        using (var image = generator.Render(50, 250))
        using (var ms = new MemoryStream())
        {
            image.Save(ms, ImageFormat.Jpeg);
            data = ms.GetBuffer();
        }

        return data;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:27:42+00:00Added an answer on May 21, 2026 at 11:27 am

    Something was fishy in sending the image wrapper to the print spooler. What i wound up doing was to use iTextSharp’s barcode 128 class and basically build the barcode out of a font instead of an image, then for human readable text i just passed in my barcode object’s fixture tag string and set that value to a value on my .RDLC report. If anyone wants any code please feel free to PM me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using: ASP.NET 4, SQL 2008, C# I'm writing a web app for our projects
I am currently using ASP.NET MVC1 in my project but now i am planing
I have a project in ASP.NET MVC1 using VB.NET controlers and JqGrid. it works
We have an ASP.Net MVC 1.0 solution developed using Visual Studio 2008 and .net
Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />
I'm working on an application using ASP.NET MVC 1.0 and I'm trying to inject
We employ Out-of-Process SQL Session State, ASP.NET 3.5 MVC 1.0 and Forms Authentication using
I'm trying to implement an RssResult that derives from ActionResult in ASP.NET MVC 1
I am using ASP.NET MVC 1.1 with Windows authentication. I trying to only authorize
Kinda new at this... I am using ASP.net MVC 1 and I am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.