Solved

DDE D3 Netscape print

Posted on 1998-06-30
6
274 Views
Last Modified: 2010-04-04
I have D3 controlling Netscape through DDE just fine. Now I need to control the printing of the HTML document from my D3 app, not Netscape. Can this be done ? Do I need to go to OLE ? Has anyone done this either in DDE or in OLE ?
0
Comment
Question by:kupiec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1356681
As far as I know, you cannot print via DDE. But this is what I found in one of the groups:

.
Subject:
             Navigator Printing
        Date:
             Wed, 17 Jun 1998 13:40:58 +0100
        From:
             Julian Coombes <julianc@intelligentwave.com>
 Organization:
             Another Netscape Collabra Server User
 Newsgroups:
             netscape.ncapi.windows

Just for information, I've been trying to get my embedded navigator to
print from an MFC application. The solution I've come to is relatively
simple...

WinExec("Netscape.exe /print(\"index.html\")",SW_SHOW);

you can also use the "/printto" command which takes four parameters
url, printer, printer_driver, port

I'm not sure of the syntax of the /printto option but if you want to use
it, you can experiment from a command line by simply typing something
like.

Netscape /printto ("myfile.html myprinter mydriver myport").

Julian.
.

see also:
http://developer.netscape.com/docs/manuals/deploymt/options.htm
http://home.netscape.com/newsref/std/ddeapi.html#about
0
 

Author Comment

by:kupiec
ID: 1356682
The command line argument which you list here does not seem to be accepted by Netscape. It tries to interpret it as a server name or URL.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1356683
I didn't check it. Sorry I am not familiar with this issue.I hope someone else can help you.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
ZifNab earned 250 total points
ID: 1356684
Hi kupiec,

Why not just getting the html document and printing it with the HTML control?

Printing a WEB page with the HTML control?
Question:
How do I print a WEB page with the HTML control?
Answer:
Use either the HTML control's AutoPrint method, or
alternatively use the PrintPage method.

Example using AutoPrint:

uses Printers;

procedure TForm1.Button1Click(Sender: TObject);
var
  OldCur: TCursor;

begin
  OldCur := Screen.Cursor;
 
  with Printer do begin
    BeginDoc;
    HTML1.AutoPrint(handle);
    Title := HTML1.URL;
    EndDoc;
  end;

  Screen.Cursor := OldCur;
end;

Zif.
0
 

Author Comment

by:kupiec
ID: 1356685
This looks like a possible solution, except that it always prints a blank page instead of the HTML document.
0
 

Author Comment

by:kupiec
ID: 1356686
Well,
I got past my ignorance and this now seems to work. Can you give advice on how to detect two things:
1. When the entire page is loaded.
2. When the page printing is completed.
Welcome to the points !
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 135
Delphi Yen format 3 75
Drag & Drop... Data from one grid to another 2 56
Using MMsystem To change audio input 1 40
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question