473,734 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server Side Printing

ccg
I am trying to print a file from an ASP script but haven't been able
to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being
generated from the script and I want a way to print this file. An EPL
file is basically printed the same way as a postscript PRN would be
printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing
within ASP.

I have tried creating a batch file and calling that from ASP using the
code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem to
work. I did give permissions to CMD and Command but it's still not
working. Is that because "copy" is part of Command? I also tried
DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP script at
all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only be used
as an internal application.

Thanks in advance for any advice or suggestions.

Corbin G

email me at my first name and first letter of last name at the google
mail service domain
Jul 22 '05 #1
6 3686
What does your batch file look like and the code that you're using to
execute it?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41******** ********@msnews .microsoft.com. ..
I am trying to print a file from an ASP script but haven't been able to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being
generated from the script and I want a way to print this file. An EPL file is basically printed the same way as a postscript PRN would be
printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing
within ASP.

I have tried creating a batch file and calling that from ASP using the code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem to work. I did give permissions to CMD and Command but it's still not
working. Is that because "copy" is part of Command? I also tried
DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP script at all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only be used as an internal application.

Jul 22 '05 #2
ccg
print.asp contains
set wshell = CreateObject("W Script.Shell")
wshell.run "c:\inetpub\www root\ups\print. bat"
set wshell = nothing

print.bat contains:
copy c:\inetpub\wwwr oot\ups\label.e pl lpt1

I also tried changing the path in print.bat to be the local path:

copy y:\ups\label.ep l lpt1

The page loads and doesn't give any errors but nothing prints.

Thanks for your assistance.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote:
What does your batch file look like and the code that you're using to
execute it?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41******* *********@msnew s.microsoft.com ...
I am trying to print a file from an ASP script but haven't been

able
to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being
generated from the script and I want a way to print this file. An

EPL
file is basically printed the same way as a postscript PRN would be
printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing
within ASP.

I have tried creating a batch file and calling that from ASP using

the
code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem

to
work. I did give permissions to CMD and Command but it's still not
working. Is that because "copy" is part of Command? I also tried
DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP script

at
all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only be

used
as an internal application.



Jul 22 '05 #3
If you run the batch file while logged onto the server does it work?

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

"ccg" <bl**@yahoo.com > wrote in message
news:41******** ********@msnews .microsoft.com. ..
print.asp contains
set wshell = CreateObject("W Script.Shell")
wshell.run "c:\inetpub\www root\ups\print. bat"
set wshell = nothing

print.bat contains:
copy c:\inetpub\wwwr oot\ups\label.e pl lpt1

I also tried changing the path in print.bat to be the local path:

copy y:\ups\label.ep l lpt1

The page loads and doesn't give any errors but nothing prints.

Thanks for your assistance.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote:
What does your batch file look like and the code that you're using to
execute it?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41****** **********@msne ws.microsoft.co m...
I am trying to print a file from an ASP script but haven't been

able
to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being
generated from the script and I want a way to print this file. An

EPL
file is basically printed the same way as a postscript PRN would be
printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing
within ASP.

I have tried creating a batch file and calling that from ASP using

the
code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem

to
work. I did give permissions to CMD and Command but it's still not
working. Is that because "copy" is part of Command? I also tried
DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP script

at
all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only be

used
as an internal application.


Jul 22 '05 #4
ccg
I am logged onto the server when I print it from the workstation.
But, I assume you mean from the server itself? If so, then I have not
tried it. The server is not setup to use this printer at all.

"Mark Schupp" <no******@email .net> wrote:
If you run the batch file while logged onto the server does it work?

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

"ccg" <bl**@yahoo.com > wrote in message
news:41******* *********@msnew s.microsoft.com ...
print.asp contains
set wshell = CreateObject("W Script.Shell")
wshell.run "c:\inetpub\www root\ups\print. bat"
set wshell = nothing

print.bat contains:
copy c:\inetpub\wwwr oot\ups\label.e pl lpt1

I also tried changing the path in print.bat to be the local path:

copy y:\ups\label.ep l lpt1

The page loads and doesn't give any errors but nothing prints.

Thanks for your assistance.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote:
What does your batch file look like and the code that you're using to
execute it?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41***** ***********@msn ews.microsoft.c om...
I am trying to print a file from an ASP script but haven't been
able
to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being
generated from the script and I want a way to print this file. An
EPL
file is basically printed the same way as a postscript PRN would be
printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing
within ASP.

I have tried creating a batch file and calling that from ASP using
the
code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem
to
work. I did give permissions to CMD and Command but it's still not
working. Is that because "copy" is part of Command? I also tried
DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP script
at
all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only be
used
as an internal application.



Jul 22 '05 #5
Your ASP code is trying to print on the server, not on the client. Only a
printer attached to the server can be used the way that you describe.

In order to use a printer on the client you will have to download the data
file and then use client-side code to print it (will probably need a
client-side component for that). Try asking on a client-side group.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

"ccg" <bl**@yahoo.com > wrote in message
news:41******** ********@msnews .microsoft.com. ..
I am logged onto the server when I print it from the workstation.
But, I assume you mean from the server itself? If so, then I have not
tried it. The server is not setup to use this printer at all.

"Mark Schupp" <no******@email .net> wrote:
If you run the batch file while logged onto the server does it work?

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

"ccg" <bl**@yahoo.com > wrote in message
news:41****** **********@msne ws.microsoft.co m...
print.asp contains
set wshell = CreateObject("W Script.Shell")
wshell.run "c:\inetpub\www root\ups\print. bat"
set wshell = nothing

print.bat contains:
copy c:\inetpub\wwwr oot\ups\label.e pl lpt1

I also tried changing the path in print.bat to be the local path:

copy y:\ups\label.ep l lpt1

The page loads and doesn't give any errors but nothing prints.

Thanks for your assistance.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote:

What does your batch file look like and the code that you're using to
execute it?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41**** ************@ms news.microsoft. com...
> I am trying to print a file from an ASP script but haven't been
able
> to find any way of making this happen.
>
> I have an EPL (Eltron Thermal Printer language) file that is being
> generated from the script and I want a way to print this file. An
EPL
> file is basically printed the same way as a postscript PRN would be
> printed. From a command prompt I can type:
>
> copy label.EPL LPT1
>
> and get the thing printed. I want to be able to do this same thing
> within ASP.
>
> I have tried creating a batch file and calling that from ASP using
the
> code at http://www.aspfaq.com/show.asp?id=2059 but that didn't seem
to
> work. I did give permissions to CMD and Command but it's still not
> working. Is that because "copy" is part of Command? I also tried
> DynuExec but that didn't do the trick either.
>
> Is there any way to copy a file to LPT1 from within an ASP script
at
> all? How about JavaScript? I'm ok with any kind of creative
> solutions...it doesn't have to be elegant since this will only be
used
> as an internal application.


Jul 22 '05 #6
Try mapping LPT1 to a printer first.

net use lpt1: \\server\prints hare
copy y:\ups\label.ep l lpt1
net use lpt1: /d
Is Y: a local drive?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41******** ********@msnews .microsoft.com. ..
print.asp contains
set wshell = CreateObject("W Script.Shell")
wshell.run "c:\inetpub\www root\ups\print. bat"
set wshell = nothing

print.bat contains:
copy c:\inetpub\wwwr oot\ups\label.e pl lpt1

I also tried changing the path in print.bat to be the local path:

copy y:\ups\label.ep l lpt1

The page loads and doesn't give any errors but nothing prints.

Thanks for your assistance.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote:
What does your batch file look like and the code that you're using toexecute it?

--

Ray at work
Microsoft ASP/ASP.NET MVP
"ccg" <bl**@yahoo.com > wrote in message
news:41******* *********@msnew s.microsoft.com ...
I am trying to print a file from an ASP script but haven't been

able
to find any way of making this happen.

I have an EPL (Eltron Thermal Printer language) file that is being generated from the script and I want a way to print this file. An
EPL
file is basically printed the same way as a postscript PRN would
be printed. From a command prompt I can type:

copy label.EPL LPT1

and get the thing printed. I want to be able to do this same thing within ASP.

I have tried creating a batch file and calling that from ASP usingthe
code at http://www.aspfaq.com/show.asp?id=2059 but that didn't
seemto
work. I did give permissions to CMD and Command but it's still
not working. Is that because "copy" is part of Command? I also tried DynuExec but that didn't do the trick either.

Is there any way to copy a file to LPT1 from within an ASP

scriptat
all? How about JavaScript? I'm ok with any kind of creative
solutions...it doesn't have to be elegant since this will only
beused
as an internal application.


Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1319
by: Stuart Woodard | last post by:
I am struggling to develop a robust mechanism for server-side printing with formatted documents. I need to produce print-spool files from the remote server-side application. This isn't straightforward with PrintDocument, so I have had to create a new class that uses Windows calls from within the PrintPage event. That solved the spool file problem, but I have since been having trouble with formatted text. To use PrintPage events, I...
7
8431
by: ap | last post by:
Hi, It is a quick question... Is that impossible to print the page(Web Form .aspx file) in client side using GDI+ like PrintDocument pd = new PrintDocument(); pd.print(); As I know it is a server side printing... and is that possible to make it to client side printing or it must be printed using javascript??
3
2414
by: Ahmad Abu-Raddad | last post by:
Hey Guys, Does anyone knows of a way to print HTML source directly to the printer (Server Side)?. I tried the PrintDocument class and the e.Graphics.DrawString and e.Graphics.DrawImage() but these does not take HTML. If anyone can help please do.
1
1160
by: Franck | last post by:
Hello, I need to implement the following features: I need to create a document on whatever format word, pdf … A simple one; few field taken from a DB. This document should be printed on a client specified printer (on intranet) and may not be stored. I thought about going on to crystal report but it seems sort of complicated as I start from scratch I also thought about generate de file on a server directory,
1
1676
by: sprash25 | last post by:
Hi, I am using a rich text editor (FCKEdit) on a webpage in which user can enter formatted text. The output of this control is HTML. Now on the code behind side, I need to change some of this HTML and then print the HTML (the pretty document - not the code) on the server printer. Any ideas??
4
5898
by: Lucas Ponzo | last post by:
Hi All, I have an ASP.NET 2.0 app. The users access the pages, uniquely via pocket pc ... I need to print a page. But I need that the page print on a printer installed on the web server hosting my application. Step 1) The user clicks the Print icon in the web page
3
2364
by: eddyger | last post by:
Hi, I would like to print to a printer connected to my IIS server. I mean "I DONT WANT TO PRINT ON EVERY PRINTER IN THE WORLD". (many answers are thinking javascript printing to the user side) I just want to print on the server side only for me (in ASP of course) Another thing to consider is that i use a local printer that generate PDF (Acrobat Distiller driver + ghostscript + redmon port redirector ). My server side printer name is...
1
1569
by: ChrisN | last post by:
I have a requirement to generate and print good-looking customised correspondence. I would like to be able to use mark-up for formatting, ie as a MS Word or HTML document. However Word doesn't seem to be an option because of various problems including print dialog boxes and licensing. Is there an engine that will render HTML and print it? I can't
3
2390
by: mygroup | last post by:
Hello Folks, I have an asp.net application which requires to fill a form. Once the form is completed, it should print the final page on server side (not the client side). I tried to use SHDocVw.InternetExplorer object. It opens up the window but it is hidden(even if it I make visible property to True). If I given print command, it does nothing. Here is my code. I have added reference of Interop.SHDocVw.dll Imports System.Threading
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6737
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6033
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4813
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3262
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.