Solved

Printing to a receipt printer in HTML ASP.NET App

Posted on 2010-11-18
12
1,563 Views
Last Modified: 2012-05-10
I have an ASP.NET app that creates a receipt in a small panel on my web page. I have some code that sends the panel contents to a popup page and then gets printed.  The receipt prints fine on regular printers but the characters are large and cuttoff on the receipt printer. No matter what font I choose the printing looks exactly the same.  The same receipt posted into note pad prints fine.  A snippet of the ASP code is here:

asp:Panel ID="Panel1" runat="server">
        <style type="text/css">
       
        .styleReceipt
        {
            font="Lucida Console" ;
            font-size:  x-small ;            
        }
        </style>
        <table class="style1">
            <tr>
                <td align="center" colspan="2">
                    <asp:Label ID="lbCompanyName" runat="server" Text="Company Name"
                        style="font-family: 'Lucida Console'; font-size: x-small" ></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <asp:Label ID="lbStoreName" runat="server" Text="Store Name" CssClass="styleReceipt"></asp:Label>
                </td>
            </tr>

etc.

Any suggestions are appreciated.
0
Comment
Question by:bfeddish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34169684
Have you installed a driver for the receipt printer?  And do you have the docs for it?  Make and Model?
0
 
LVL 1

Author Comment

by:bfeddish
ID: 34169870
I'm doing this remotely and they say they have the prier driver installed. Its a Bixolon SRP-275A Receipt printer.   I am going to go pick it up tommorow and bring it back to my office.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34169908
Looks like you can get the drivers here: http://www.crs-usa.com/soft-dot.asp
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 3

Expert Comment

by:saifikram_md
ID: 34177210
Check if the page is getting the styles from themes.
0
 
LVL 1

Author Comment

by:bfeddish
ID: 34177303
I've tried everything.  I went down and picked up the receipt printer and laptop. The drvers are intalled. If I print from notepad it looks great. I've tried tons of fonts on a plain html page and none work. I am still working on it now trying to find a solution.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34177797
I was wondering if it doesn't print graphics, maybe it's only an old fashioned line / character printer.
0
 
LVL 1

Author Comment

by:bfeddish
ID: 34177971
If I change the font on the web page the font on the printer changes, it's just unreadable. The characters are squashed togther.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34178055
I took a look at the manual for the printer on that page I linked above.  I saw three font sizes listed in the printer codes but nothing I recognized as graphics commands.  I don't think that thing prints anything but plain text in it's own internal fonts.  Windows fonts are printed as graphics.  Notepad will print plain text I believe.
0
 
LVL 1

Author Comment

by:bfeddish
ID: 34178063
How do I get my web page to print plain text?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 34178103
I don't know at this point.  I was reading the manual included in the printer driver zip file and it has a section about using Wordpad to test the printer.  Note that some of the codes are used to 'open the cash drawer' and other mechanical functions.  It does say that it will print Windows fonts like Arial.  I'd read the manual and see if what they say there actually works.
0
 
LVL 1

Author Closing Comment

by:bfeddish
ID: 34277359
I ended up picking some really odd font after lots of traial and error then setting the character width, height and spacing manually. It's actually unreadable on the screen but prints fine to the printer. I am awarding the points to Dave for putting so much time into this and keeping me on my toes while working through this issue.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34278183
Thanks.  Glad you found a way to make it work.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question