I need asp.net print page task, DOT NET Programming

Assignment Help:

I need asp.net print page task

Project Description:

I have a little task on asp.net, I need to print a text data to receipt printer from web page, I used the subsequent code and it works fine on my local machine:

Service service = null;

protected void Page_Load(object sender, EventArgs e)

{

try

{

ServiceFunc serv = new ServiceFunc();

service = serv.GetService(Convert.ToInt32(Session["servid"]));

printpage();

}

catch (Exception ex)

{ }

}

 

public void printpage()

{

PrintDialog pd = new PrintDialog();

PrintDocument pdoc = null;

pdoc = new PrintDocument();

Response.Write("1");

PrinterSettings ps = new PrinterSettings();

Font font = new Font("Courier New", 12);

PaperSize psize = new PaperSize("Custom", 300, 400);

pd.Document = pdoc;

pd.Document.DefaultPageSettings.PaperSize = psize;

pdoc.DefaultPageSettings.PaperSize.Height = 600;

pdoc.DefaultPageSettings.PaperSize.Width = 300;

Response.Write("2");

pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

Response.Write("3");

PrintPreviewDialog pp = new PrintPreviewDialog();

pp.Document = pdoc;

Response.Write("4");

pdoc.Print();

Response.Write("5");

}

void pdoc_PrintPage(object sender, PrintPageEventArgs e)

{

Graphics graphics = e.Graphics;

Font font = new Font("Courier New", 10);

graphics.DrawString("XXX", new Font("Courier New", 9), new SolidBrush(Color.Black), startX, startY + Offset);

}

if you have a solution or another way to print.

Skills required are .NET, ASP, Print, C# Programming


Related Discussions:- I need asp.net print page task

Describe the architecture of the .net framework, Question: (a) What is...

Question: (a) What is VB.NET 2005 and explain the versions of VB.NET. Name the four different types of applications that new version of VB.NET can create. (b) Using the

Different types of replication supported by sql server, What are the differ...

What are the different types of replication supported by SQL SERVER? There are 3  types of replication supported by SQL SERVER which are shown below:- 1) Snapshot Replicati

Define an event, Define an event. Whenever an action takes place in a c...

Define an event. Whenever an action takes place in a class, that class gives a notification to other classes or objects that are assigned to perform certain tasks. These notifi

Case statement, Design the following interface and add code to the command ...

Design the following interface and add code to the command buttons to achieve the following using case statement. I) find coursework to be calculated using the following formula:-0

Develop membership plans in asp.net, First let me start by saying that I ha...

First let me start by saying that I have been writing code for almost 25 years. So I am only looking for someone to assist advance a project I am working on. Someone that is unders

Accepting a list of 5 items - c# program, Accepting a List of 5 Items - C# ...

Accepting a List of 5 Items - C# Program Hello, I've been trying so many codes for this but those codes didn't work well. Please write the code for Accepting a List of 5 Items

File upload in asp.net, upload files using file upload control to google dr...

upload files using file upload control to google drive

Reading strings from the keyboard, Reading strings from the keyboard   ...

Reading strings from the keyboard   using System; class Prog3_1 {       public static void Main()   {    Console.Write ("Enter Your First Name : "); // Displaying to writ

Downloadable software for a pc computer and mac, Downloadable software for ...

Downloadable software for a PC computer and Mac Project Description: "The software" can be sold as a downloadable purchase. I must have all copy rights to "the software" when

What is the difference between thread and process, What is the difference b...

What is the difference between thread and process?  Thread - is used to implement more than one program at a time. process - implements single program A thread is a path

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd