Click here to Skip to main content
15,867,939 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am creating an eCommerce website for a client. I am using web forms. I do not know how to print a copy of the Order to the printer of the user logged in to the web page.

I would appreciate any help you can offer me.

What I have tried:

I don't know where to begin, so I started here.
Posted
Updated 23-Aug-21 7:06am

Begin at the beginning: ecommerce print order - Google Search[^].
 
Share this answer
 
Comments
Slow Eddie 23-Aug-21 10:32am    
Thank you I will.
Code running on the server (C#, VB.NET, etc) has no access to hardware attached to the user's computer.

Code running on the client (Javascript) has virtually no access to the user's hardware. All you can do is call window.print()[^] to print the current window, and use CSS print media queries to try to control how your page is printed.

If you have a report with the order details which you're trying to print, see if you can export it to PDF instead, and send that to the user. They can then chose to save or print it as required.
 
Share this answer
 
Comments
Slow Eddie 23-Aug-21 10:34am    
Thank you. This Helps. I may need to buy a software tool to handle it for me.
OriginalGriff 23-Aug-21 11:44am    
Not necessarily - Have you looked at the open source PDFSharp?

http://www.pdfsharp.net

I believe iTextSharp / iText7 can also produce them:

https://www.nuget.org/packages/itext7/
Quote:
I do not know how to print a copy of the Order to the printer of the user logged in to the web page.

Basically, you don't.
On your site, you generate a page printer friendly or generate a PDF with receipt, and the client prints it if he wants.
Your server just have no idea if client have a printer or not.
Being able to print on client's printer is dream feature for malware.
 
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