?
Solved

Print text to printer as HTML

Posted on 2001-08-04
6
Medium Priority
?
271 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Accepted Solution

by:
edey earned 560 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
 

Expert Comment

by:SpideyMod
ID: 8145019
Administrative Action - Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month15 days, 9 hours left to enroll

850 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