By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,573 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,573 IT Pros & Developers. It's quick & easy.

Sending binary data to client printer via web page.

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.