Solved

Print text to printer as HTML

Posted on 2001-08-04
6
254 Views
Last Modified: 2010-04-04
i got a lil problem, i want to Print memo1.lines to the printer but not as ?lain text but as HTML

the memo1.lines is written as a HTML webpage so i dont think it shouldnt be hard so hard...
0
Comment
Question by:TeChNiCh
6 Comments
 
LVL 6

Expert Comment

by:edey
ID: 6352245
Then you'd have to render it. Prob the easiest way would be to load it into a TWebBrowser & let IE print it for you, something like this:

procedure TForm1.Button1Click(Sender: TObject);
var
   vaIn, vaOut: OleVariant;
   ms : TMemoryStream;
begin
     ms := TMemoryStream.create;
     memo1.Lines.saveToStream(ms);
     WebBrowser1.Document as IPersistStreamInit).Load(TStreamAdapter.Create(AStream);
     ms.free;
     while webBrowser1.busy do
           application.processMessages;
     WebBrowser.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut);
end;

GL
Mike
0
 
LVL 21

Expert Comment

by:gemarti
ID: 6352249
I don't think you can print from a Memo component.

have you tried putting the information into a RichEdit component and printing?

Richedit1.Print(string);
0
 

Author Comment

by:TeChNiCh
ID: 6357732
WebBrowser1.Document as IPersistStreamInit).Load(TStreamAdapter.Create(AStream);

get a lil error there
IPersistStreamInit undeclared identifier
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Accepted Solution

by:
edey earned 140 total points
ID: 6357789
I belive that it's declared in activeX.pas so you'll need to add activeX to your uses clause.

GL
Mike
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7872455
0
 

Expert Comment

by:SpideyMod
ID: 8145019
Administrative Action - Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi with SQL Natvie Client 15 86
proper way to parse url in delphi 2 164
How to create virtual printer while installing my application 5 24
update joined tables 2 31
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now