473,569 Members | 2,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

printing an HTML file on a windows printer

1 New Member
Greetings.

I'm attempting to print an existing html file to a network printer.

I tried opening a socket connection using the printer ip and port. With this, I was able to print the file path/name on the printer, ala...

Expand|Select|Wrap|Line Numbers
  1.  my $socket = IO::Socket::INET->new(PeerAddr => $peerAddr,
  2.                                             PeerPort => $peerPort,
  3.                                             Proto => 'tcp',
  4.                                             Type => SOCK_STREAM,
  5.                                             );
  6.  
  7.          # If we can't print, display an error message and quit.
  8.          if (! $socket) {
  9.             my $errorText = "Couldn't connect to printer at $peerAddr\:$peerPort : $@\n";
  10.             printLog($ERROR, $method, $errorText, __LINE__);
  11.             displayErrorWin($errorText);
  12.  
  13.             exitScript(1);
  14.          }
  15.  
  16.          printLog($DEBUG, $method,
  17.                   "##### Printing file: $fullFilePath to: $peerAddr\:$peerPort",
  18.                   __LINE__);
  19.  
  20.          print $socket $fullFilePath;
This at least showed I can "talk" to the printer.

Next, I tried various flavors of using HTML::Stream without any success.

I can print the html file from Internet Explorer.
I appreciate any help.

I thank you,
Dutch
Feb 22 '07 #1
0 1312

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3318
by: Donnal Walter | last post by:
We want to be able to print HTML or PDF files to a given printer from Python in a kind of batch mode (without opening a preview window or printer dialog for each file). The printer is on a network, but for testing purposes I have connected it to my desktop via LPT1. I can easily print a text file from Python using: os.system("copy some.txt...
10
24868
by: Brian Hanson | last post by:
Hi, I am trying to programmatically print a pdf file via an asp.net application. I have seen other postings that mention the following code used or something similar to it in a vb.net app. Process.Start("C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe", "/p /h ""C:\Program Files\Adobe\Acrobat 5.0\Help\ENU\ACROBAT.PDF""")
1
5208
by: BJS | last post by:
Sorry for the cross-posting, but based on the number of people I have seen ask for a solution to this problem, I hope by cross-posting this, that it will help a lot of people out of a common problem. Have you ever wanted to use print to a file using the System.Drawing.Printing namespace only to find out that the only way to do it is by...
0
1638
by: DotNetDummy | last post by:
Hi all, I am trying to set the printing setting e.g duplex mode etc. on a default printer when I.E object started printing a particular html doc. Here's the partial code, any help would be appreciated. I have been using system.drawing.printing method but not much help since drawing.printing required printDocument() object which...
16
48843
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free...
2
5813
by: Benny | last post by:
Hello Experts, Currently I working on a web application using vs.net with C#. I require to create an invoice to a text file and print the file. I have no problem with writing to the text, but how can I print a text file using C# in a web application? Any articles that shows you how can this be done will be great.
2
14736
by: David Cuffee | last post by:
I am not having any luck printing a simple text file with PCL codes to my windows printer. If I have a text file with PCL codes and I want to dump that file to my default windows printer, how would I do that in C#? I tried just putting the printDocument1 object on my form and doing this: printDocument1.DocumentName = "C:\\Tablerep.prn";...
7
2557
by: Iain Wilson | last post by:
I am pulling my hair out trying to print various objects from a .net web page My apologies for cross posting but I need an answer and my previous post has attracted no interest. ASP.Net 2.0 using C# This is a simple web page on our intranet (written as a test) and all I am trying to do is print a document to a named printer. If I use a...
18
11271
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing classes, for each of the checked rows in the GridView. This works fine in the Visual Studio 2005 development environment on localhost. But, when I...
0
7701
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...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
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
1
1223
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.