473,403 Members | 2,222 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,403 software developers and data experts.

HTML Printing Options

Hi,

My back is against the wall and I've tried to figure out something to do.
Here is my scenario:

I have an automated process running in a service that generates HTML files.
Each resulting file can be sent to one of the printers on the network -- not
necessarily the default. It would seem that the AxWebBrowser control would
be a good way to print the files, however, it only prints to the default
printer for that user when you issue the ExecWB command.

Here is the process:

1. Data is received from a data source
2. Each row is used to create the HTML file and also defines its
destination.
3. An HTML file is created;
4. The HTML file is delivered/printed, etc. to the destination specified in
that row of data.
5. Go back to #2 until there are no rows left.

Right now, I'm looking for any thoughts on how I can do this. I don't care
if I have to write a C++ object and use Interop to use it. The best case
scenario seems to be to get something that will print HTML to a dynamic
printer location. Here are some things I have thought of:

A. Have another service that would monitor a "spool" type of a directory.
When the HTML file is generated, it would be put into that directory with an
XML file defining where it should go. The service would read that
information and change the registry defining the default printer, page
settings, etc. It would open an instance of the AxWebBrowser control, print
the document, and destroy the control.

B. Somehow use MSOHTMED (Microsoft Office's HTML editor component). By
looking a the "print" command for HTML file types in folder options, I see
this command: "<path>/msohtmed.exe /p %1" Unfortunately, I don't see where
you could specify the destination with this solution unless I modify the
registry ahead of time similar to option A.

C. Automate Microsoft Word. Through Word automation, I can specify the
printer destination, document settings (page size, etc.) directly through
code. This would require Office to be installed on the server, however.

D. Somehow, convert to PCL, then print the PCL to a raw location. This
would follow a similar train of thought as option A, but how do I convert
HTML to PCL? Use a print driver? I thought of defining a printer that
prints to a file, but that always prompts for a filename. If there was a
way I could dynamically specify a filename, that would be good.

Anyway, any help would be absolutely wonderful. If possible, I would like
to avoid solutions that are very expensive. If there is a control or a
library out there that would help, I would certainly like to look at it.

Thank you in advance,
cj

Nov 16 '05 #1
1 5717
Take a look at some of the offerings from http://www.activepdf.com/,
specifically:

"activePDF WebGrabber™ is the industry leader in scalable, multithreaded
URL-to-PDF or HTML-to-PDF generation. Whether converting static HTML
files or dynamic, data-driven web-based reports, WebGrabber provides the
functionality and control needed to create secure, useable, and
printable PDF files."

and

"activePDF Spooler™ allows you to redirect PDF documents to any printer
on your network, without requiring any end-user intervention!"

I haven't used these particular products, but I've worked with some of
their other tools and they seem reliable and pretty-well documented.

-Jason
Curtis Justus wrote:
Hi,

My back is against the wall and I've tried to figure out something to do.
Here is my scenario:

I have an automated process running in a service that generates HTML files.
Each resulting file can be sent to one of the printers on the network -- not
necessarily the default. It would seem that the AxWebBrowser control would
be a good way to print the files, however, it only prints to the default
printer for that user when you issue the ExecWB command.

Here is the process:

1. Data is received from a data source
2. Each row is used to create the HTML file and also defines its
destination.
3. An HTML file is created;
4. The HTML file is delivered/printed, etc. to the destination specified in
that row of data.
5. Go back to #2 until there are no rows left.

Right now, I'm looking for any thoughts on how I can do this. I don't care
if I have to write a C++ object and use Interop to use it. The best case
scenario seems to be to get something that will print HTML to a dynamic
printer location. Here are some things I have thought of:

A. Have another service that would monitor a "spool" type of a directory.
When the HTML file is generated, it would be put into that directory with an
XML file defining where it should go. The service would read that
information and change the registry defining the default printer, page
settings, etc. It would open an instance of the AxWebBrowser control, print
the document, and destroy the control.

B. Somehow use MSOHTMED (Microsoft Office's HTML editor component). By
looking a the "print" command for HTML file types in folder options, I see
this command: "<path>/msohtmed.exe /p %1" Unfortunately, I don't see where
you could specify the destination with this solution unless I modify the
registry ahead of time similar to option A.

C. Automate Microsoft Word. Through Word automation, I can specify the
printer destination, document settings (page size, etc.) directly through
code. This would require Office to be installed on the server, however.

D. Somehow, convert to PCL, then print the PCL to a raw location. This
would follow a similar train of thought as option A, but how do I convert
HTML to PCL? Use a print driver? I thought of defining a printer that
prints to a file, but that always prompts for a filename. If there was a
way I could dynamically specify a filename, that would be good.

Anyway, any help would be absolutely wonderful. If possible, I would like
to avoid solutions that are very expensive. If there is a control or a
library out there that would help, I would certainly like to look at it.

Thank you in advance,
cj

Nov 16 '05 #2

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

Similar topics

5
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,...
6
by: Alec | last post by:
Hi, I am trying to print an HTML page from Internet Explorer and it always put the page title and page count at the top of the page. How can I disable printing page title and page count? Thanks.
15
by: Birahim FALL | last post by:
Hi, I'm very fresh to PostgreSQL, coming from Oracle. I want to developp web applications based on apache and postgresql. Is there an equivalent of OWA server (Oracle Web Application server) for...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
4
by: Tracey | last post by:
Hey folks, I have an ASP.NET web app that's working just fine, but a small percentage have two printing problems that don't happen to the vast majority of users. These problems are listed below...
4
by: Tom Leylan | last post by:
Are we past the point when we need to print source code? I'm having two problems. The most important one is that opening a .vb file and simply printing it _does_ print the source but code...
1
by: Dreamtime | last post by:
Hi I am using Visual Studio 2005 and the bundled Crystal Reports (previously I used .net 2003 and bundled Crystal Reports for 2 years - same issues!) I have a report which is displayed in the...
1
by: Stinky Pete | last post by:
Hi, I've been reading, and successfully tested some code referred to in this group, that allows a user to select a printer before printing a report. The code has worked well on single page...
2
by: deepakfordotnet | last post by:
Hi, First of all let me confess that I could not get the solution to the same problem from an earlier post Printing :by Mr.Richard MSL (dated September 24th 2006) working. (Replied by Mr.Walter...
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: 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
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...
0
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...
0
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,...

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.