473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Sending binary data to client printer via web page.

I hope I posted this to the correct group. If not, please let me know and I
will get it posted in the correct section.

I have a web application developed in ASP.NET using C# for the code behind.
I need to be able to print shipping labels from a web page within this
application. The shipping label data is pulled from a 3rd party application
and comes in binary format specific for certain brands of label printers. I
have a class library written (in C#) to handle sending the raw data directly
to a selected printer that is compiled into a seperate dll. I am in need of a
way to be able to instantiate an object from this class library and call a
method that will send the raw data to the client's printer. My assumption was
that I would be able to accomplish this via an ActiveX approach and in some
way or form package the dll up so that it would get delivered client side and
then have access to the printer port, but I am having a heck of a time trying
to track down any info/articles on how to do this.

Basically, the procedure needs to go as follows:

1. Client fills out a form for shipment information and clicks a submit
button.
2. Code behind handles the click event, transmitting the label request to a
3rd party and receiving back the binary data for the label, then sending that
binary data directly to a selected printer (by calling a static method in the
class library dll that handles the delivery to the printer).

If someone could just point me in the right direction of where to find info
on how to accomplish this it would be most appriciated!
Feb 8 '06 #1
4 4192
Hi,

Thanks for posting!

Based on my understanding, the current issue is that the ActiveX control
handles the data from the ASP.NET and sends it to the client printer. If I
have anything misunderstanding, please let me know.

From your description, the data submitted from the client can be deal with
the ASP.NET application. After the manipulation, we can use the
Response.BinaryWrite method to send the binary data to the client. Then, we
use the ActiveX control to print.
"2. generate a pdf file and send it back to the client, then the end user

could print the pdf file directly."
As far as I know, this is a common way to implement the current
requirement. There are many samples from third party. Please reference
these.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 8 '06 #2
Currently I do not have an ActiveX control implemented to push the data to
the client's printer. That is the component I am looking to build. I need to
be able to send the binary data directly to the printer, I can't reconstruct
it into a different format (like a pdf). I have a Windows Forms application
that also handles the label printing but of course that app has access to the
client's hardware. What I am in need of is a web based version of this.

I will take a look at the Response.BinaryWrite method and see if using that
and calling the window.print will work for me. Will a call to print this
actually get the binary data to the printer or will it just print a full page
with the binary data in text form? Also, if someone could please post some
links to articles on how I would go about creating an ActiveX solution using
C# and ASP.NET that would be much appriciated. My assumption is that my class
library that communicates and sends the data to the printer would have to run
on the client's machine so I would need to know how to deliver that and how
to then access that from the code behind on the web site.
""Yuan Ren[MSFT]"" wrote:
Hi,

Thanks for posting!

Based on my understanding, the current issue is that the ActiveX control
handles the data from the ASP.NET and sends it to the client printer. If I
have anything misunderstanding, please let me know.

From your description, the data submitted from the client can be deal with
the ASP.NET application. After the manipulation, we can use the
Response.BinaryWrite method to send the binary data to the client. Then, we
use the ActiveX control to print.
"2. generate a pdf file and send it back to the client, then the end user

could print the pdf file directly."
As far as I know, this is a common way to implement the current
requirement. There are many samples from third party. Please reference
these.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 8 '06 #3
Print to pdf:

http://www.hellobasic.com/cgi-bin/fo...num=1134897582
"Schwarty" <Sc******@community.nospam> schreef in bericht
news:FC**********************************@microsof t.com...
Currently I do not have an ActiveX control implemented to push the data to
the client's printer. That is the component I am looking to build. I need
to
be able to send the binary data directly to the printer, I can't
reconstruct
it into a different format (like a pdf). I have a Windows Forms
application
that also handles the label printing but of course that app has access to
the
client's hardware. What I am in need of is a web based version of this.

I will take a look at the Response.BinaryWrite method and see if using
that
and calling the window.print will work for me. Will a call to print this
actually get the binary data to the printer or will it just print a full
page
with the binary data in text form? Also, if someone could please post some
links to articles on how I would go about creating an ActiveX solution
using
C# and ASP.NET that would be much appriciated. My assumption is that my
class
library that communicates and sends the data to the printer would have to
run
on the client's machine so I would need to know how to deliver that and
how
to then access that from the code behind on the web site.
""Yuan Ren[MSFT]"" wrote:
Hi,

Thanks for posting!

Based on my understanding, the current issue is that the ActiveX control
handles the data from the ASP.NET and sends it to the client printer. If
I
have anything misunderstanding, please let me know.

From your description, the data submitted from the client can be deal
with
the ASP.NET application. After the manipulation, we can use the
Response.BinaryWrite method to send the binary data to the client. Then,
we
use the ActiveX control to print.
>"2. generate a pdf file and send it back to the client, then the end
>user

could print the pdf file directly."
As far as I know, this is a common way to implement the current
requirement. There are many samples from third party. Please reference
these.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 9 '06 #4
Hi,

Thanks for your reply!
"Will a call to print this actually get the binary data to the printer or will it just print a full page with the binary data in text form?"

As far as I know, it will print a full page with the binary data.
"if someone could please post some links to articles on how I would go

about creating an ActiveX solution using C# and ASP.NET that would be much
appriciated."

I think the ActiveX is only created by the unmanaged code. If you need this
control, I think there are many articles or solutions from third party.
Otherwise, you can post a new thread to the related newsgroup to get more
information. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 13 '06 #5

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

Similar topics

9
by: Vince C. | last post by:
Hi. This is a feature that is really going on my nerves as I've been writing SOAP Web services using ASP and SOAP toolkit 3.0. My web services ASP scripts send XML data to the client...
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
4
by: Abubakar | last post by:
Hi, I am writing a server in C# and client in C++ (pure, not managed). The communication goes on through sockets. In C# I am using NetworkStream to send text data (by converting it to byte array)...
4
by: Beginner | last post by:
How do I convert JPEG images to binary files in ASP.NET? Please advice. Thanks.
9
by: thorley | last post by:
Greetings, since there was no reponse to my previous post about an existing FastCGI server in python, I've taken to writing my own. (which of course I'll share--*if* there's something to share ;) ...
9
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
2
by: hari | last post by:
Hi all, I need to automate printer command testing, prinetr supports parallel/ serial/USB.How can i send the commands from python to printer. I have got pyparallel, as am new to python, no...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.