[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Print text to printer as HTML

Posted on 2001-08-04
6
Medium Priority
?
268 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
[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
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

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.

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

656 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