Click here to Skip to main content
15,662,484 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)

I have an Invoice Receipt like this :

                         < Invoice Receipt >                        Receipt No : 1

First Name :                                         Last Name : 

Age        :                                         Address   :

Amount Paid : 

Date of Payment : 

User insert this receipt paper in dotmatrix printer & hit print from web application then user information should display in front of their corresponding titles.

It is a web application, can anyone please help me how to achieve this.

Thanks in Advance.
Updated 13-Feb-13 19:25pm

As you are printing on the client you need to provide the client with suitably formatted html (or other file type)

You can use a print style sheet (see here[^] for a good explanation.

Alternatively you can build (say) a PDF file server-side and provide it to the user to print.
Share this answer
[no name] 14-Feb-13 1:41am    
hi, thanks for reply.
If receipt paper size is half of A4 page, Can you please let me know whether Solution 1 will work or not.
If not then what should i suppose to do to fix it.
You could certainly do it for a single page with CSS - if you want to print multiple pages 'in one go' it would be harder.

Is it necessary to have pre-printed stationery? It would be far easier to print the titles and the data together

With CSS you can specify sizes in cm (for example) so with a bit of experimentation you should be able to get it to line up OK.

If you need to be exact, then probably generating a PDF server side is the way to go. More complex to do - but there are libraries out there (such as textSharp) that would help you do that.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900